From f0100407eeeed22a4e7be53a183800dd24cef9c9 Mon Sep 17 00:00:00 2001 From: Evgeniy Stratonikov Date: Fri, 25 Jun 2021 11:02:43 +0300 Subject: [PATCH] compiler/test: compile whole directory in examples For `nft-nd-nns` example only `namestate.go` file was compiled which is certainly not what we want. Signed-off-by: Evgeniy Stratonikov --- pkg/compiler/compiler_test.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go index 0fed351a4..62c5f2b87 100644 --- a/pkg/compiler/compiler_test.go +++ b/pkg/compiler/compiler_test.go @@ -57,12 +57,8 @@ func TestCompiler(t *testing.T) { // there are also a couple of files inside the `examplePath` which doesn't need to be compiled continue } - infos, err := ioutil.ReadDir(path.Join(examplePath, info.Name())) - require.NoError(t, err) - require.False(t, len(infos) == 0, "detected smart contract folder with no contract in it") - filename := filterFilename(infos) - targetPath := path.Join(examplePath, info.Name(), filename) + targetPath := path.Join(examplePath, info.Name()) require.NoError(t, compileFile(targetPath)) } }, @@ -90,15 +86,6 @@ func TestCompiler(t *testing.T) { } } -func filterFilename(infos []os.FileInfo) string { - for _, info := range infos { - if !info.IsDir() { - return info.Name() - } - } - return "" -} - func compileFile(src string) error { _, err := compiler.Compile(src, nil) return err