diff options
author | Ayke van Laethem <[email protected]> | 2018-11-15 11:50:47 +0100 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-11-15 11:51:16 +0100 |
commit | 668c1741c3d290ed63ff8270acde62f5ac4004ab (patch) | |
tree | 418caec4b8500fe2ba205082ffb963a2757d7564 /testdata | |
parent | 6292a0fd2ebd0f2db486fb48d4e161ba95fdc9a5 (diff) | |
download | tinygo-668c1741c3d290ed63ff8270acde62f5ac4004ab.tar.gz tinygo-668c1741c3d290ed63ff8270acde62f5ac4004ab.zip |
compiler: implement array equality
Implement binops == and != on array types.
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/binop.go | 10 | ||||
-rw-r--r-- | testdata/binop.txt | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/testdata/binop.go b/testdata/binop.go index 24774aade..64a339539 100644 --- a/testdata/binop.go +++ b/testdata/binop.go @@ -24,6 +24,14 @@ func main() { println("ab" < "aa") println("aa" < "ab") + println("array equality") + println(a1 == [2]int{1, 2}) + println(a1 != [2]int{1, 2}) + println(a1 == [2]int{1, 3}) + println(a1 == [2]int{2, 2}) + println(a1 == [2]int{2, 1}) + println(a1 != [2]int{2, 1}) + println("struct equality") println(s1 == Struct1{3, true}) println(s1 == Struct1{4, true}) @@ -48,6 +56,8 @@ var a = "a" var s1 = Struct1{3, true} var s2 = Struct2{"foo", 0.0, 5} +var a1 = [2]int{1, 2} + type Struct1 struct { i int b bool diff --git a/testdata/binop.txt b/testdata/binop.txt index 1e2f40e70..72e67198a 100644 --- a/testdata/binop.txt +++ b/testdata/binop.txt @@ -20,6 +20,13 @@ true false false true +array equality +true +false +false +false +false +true struct equality true false |