Skip to content

Commit 97b008e

Browse files
committed
add mixed type match tests
1 parent df29895 commit 97b008e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

data/transactions/logic/eval_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5802,6 +5802,45 @@ int 1
58025802
int 2
58035803
int 88
58045804
match done1 done2; done1: ; done2: ;
5805+
`, 8)
5806+
5807+
// allow mixed types for match cases
5808+
testAccepts(t, `
5809+
int 1
5810+
int 100
5811+
byte "101"
5812+
byte "101"
5813+
match done1 done2; done1: ; done2: ;
5814+
`, 8)
5815+
5816+
testAccepts(t, `
5817+
byte "0"
5818+
int 1
5819+
byte "0"
5820+
match zero one
5821+
err
5822+
zero: int 1; return
5823+
one: int 0;
5824+
`, 8)
5825+
5826+
testAccepts(t, `
5827+
byte "0"
5828+
int 1
5829+
int 1
5830+
match zero one
5831+
err
5832+
one: int 1; return
5833+
zero: int 0;
5834+
`, 8)
5835+
5836+
testAccepts(t, `
5837+
byte "0"
5838+
byte "1"
5839+
int 1
5840+
match zero one
5841+
int 1; return
5842+
zero: int 0;
5843+
one: int 0;
58055844
`, 8)
58065845
}
58075846

0 commit comments

Comments
 (0)