|
|
|
@ -25,13 +25,13 @@ func Test_ImportCycle(t *testing.T) {
|
|
|
|
|
defer os.RemoveAll(dir)
|
|
|
|
|
|
|
|
|
|
mainPath := filepath.Join(dir, mainFilename)
|
|
|
|
|
err = ioutil.WriteFile(mainPath, []byte(mainSrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(mainPath, []byte(mainSrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
subAPath := filepath.Join(dir, subAFilename)
|
|
|
|
|
err = ioutil.WriteFile(subAPath, []byte(subASrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(subAPath, []byte(subASrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
subBPath := filepath.Join(dir, subBFilename)
|
|
|
|
|
err = ioutil.WriteFile(subBPath, []byte(subBSrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(subBPath, []byte(subBSrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
_, err = NewParser().Parse(mainPath)
|
|
|
|
@ -55,13 +55,13 @@ func Test_MultiImportedShouldAllowed(t *testing.T) {
|
|
|
|
|
defer os.RemoveAll(dir)
|
|
|
|
|
|
|
|
|
|
mainPath := filepath.Join(dir, mainFilename)
|
|
|
|
|
err = ioutil.WriteFile(mainPath, []byte(mainSrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(mainPath, []byte(mainSrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
subAPath := filepath.Join(dir, subAFilename)
|
|
|
|
|
err = ioutil.WriteFile(subAPath, []byte(subASrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(subAPath, []byte(subASrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
subBPath := filepath.Join(dir, subBFilename)
|
|
|
|
|
err = ioutil.WriteFile(subBPath, []byte(subBSrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(subBPath, []byte(subBSrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
_, err = NewParser().Parse(mainPath)
|
|
|
|
@ -84,13 +84,13 @@ func Test_RedundantDeclarationShouldNotBeAllowed(t *testing.T) {
|
|
|
|
|
defer os.RemoveAll(dir)
|
|
|
|
|
|
|
|
|
|
mainPath := filepath.Join(dir, mainFilename)
|
|
|
|
|
err = ioutil.WriteFile(mainPath, []byte(mainSrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(mainPath, []byte(mainSrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
subAPath := filepath.Join(dir, subAFilename)
|
|
|
|
|
err = ioutil.WriteFile(subAPath, []byte(subASrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(subAPath, []byte(subASrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
subBPath := filepath.Join(dir, subBFilename)
|
|
|
|
|
err = ioutil.WriteFile(subBPath, []byte(subBSrc), 0777)
|
|
|
|
|
err = ioutil.WriteFile(subBPath, []byte(subBSrc), 0o777)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
_, err = NewParser().Parse(mainPath)
|
|
|
|
|