diff --git a/examples/const_refs/e2e_test.go b/examples/const_refs/e2e_test.go index c26962ea..7e984401 100644 --- a/examples/const_refs/e2e_test.go +++ b/examples/const_refs/e2e_test.go @@ -8,6 +8,8 @@ import ( "github.com/stretchr/testify/require" ) +// Nested map has only one key because keys are unordered +// so having order in test will make it flacky. func Test(t *testing.T) { err := os.Chdir("..") require.NoError(t, err) @@ -22,7 +24,8 @@ func Test(t *testing.T) { require.NoError(t, err) require.Equal( t, - "map[l:[1 2 3] m:map[one:1 three:3 two:2]]\n", + `{"l": [1, 2, 3], "m": {"key": 1}} +`, string(out), ) diff --git a/examples/const_refs/main.neva b/examples/const_refs/main.neva index 22eb05a9..f56042c9 100644 --- a/examples/const_refs/main.neva +++ b/examples/const_refs/main.neva @@ -8,11 +8,7 @@ const { two int = 2 three int = 3 numsList list = [one, two, three] - numsMap map = { - one: one, - two: two, - three: three - } + numsMap map = { key: one } numsStruct NumsStruct = { l: numsList, m: numsMap