mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 13:41:37 +00:00
29 lines
754 B
Go
29 lines
754 B
Go
|
package neotest
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
)
|
||
|
|
||
|
func TestCompileFileCashedIdentifiers(t *testing.T) {
|
||
|
sender := util.Uint160{}
|
||
|
tmpDir := t.TempDir()
|
||
|
|
||
|
srcPath := "../../internal/basicchain/testdata/test_contract.go"
|
||
|
configPath1 := "../../internal/basicchain/testdata/test_contract.yml"
|
||
|
bytesRead, err := os.ReadFile(configPath1)
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
configPath2 := filepath.Join(tmpDir, "test_contract_2.yml")
|
||
|
err = os.WriteFile(configPath2, bytesRead, 0755)
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
contract1 := CompileFile(t, sender, srcPath, configPath1)
|
||
|
contract2 := CompileFile(t, sender, srcPath, configPath2)
|
||
|
require.NotEqual(t, contract1, contract2)
|
||
|
}
|