Skip to content

Commit

Permalink
Kwxm/conformance/more polymorphism tests (#5662)
Browse files Browse the repository at this point in the history
* Fix syntax in chooseData* conformance tests

* Add some more test cases

* Generalise some conformance test input types a bit

* Fix syntax error

* Corrections
  • Loading branch information
kwxm authored Dec 4, 2023
1 parent 36ac789 commit 6053780
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(program 0.0.0 (con data (
Map [ (B #0123, I 12345),
(B #456789, I 789453),
(B #0ABCDE, I 12364689486)]
Map [ (B #0123, I 12345),
(I 789453, B #456789),
(List [I -12364689486], Constr 7 [])
]
)))
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
(con
data
(Map
[(B #0123, I 12345), (B #456789, I 789453), (B #0abcde, I 12364689486)])
[ (B #0123, I 12345)
, (I 789453, B #456789)
, (List [I -12364689486], Constr 7 []) ])
)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(program 0.0.0 (con (list bool) [5])
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parse error
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(program 0.0.0 (con (list bool) [(lam x (lam y x))])
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parse error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 0.0.0 (con (pair integer string) ((lam x x), 1))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parse error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 0.0.0 (con (pair integer string) (1, (lam y y))))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parse error
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(program 0.0.0
[[[[[[(force (builtin chooseData))
(con data {ByteString #001A})]
(con data {Constr 1 [Integer 1]})]
(con data {Map [(Integer 0, ByteString #00), (Integer 1, ByteString #0F)]})]
(con data {List [ Integer 0, Integer 1 ]})]
(con data {Integer 2})]
(con data {ByteString #001A})])
(con data (B #001A))]
(lam x (con integer 1))]
(lam y (con string "two"))]
(lam z3 z3)]
(lam u (con data (I 4)))]
(lam v (con data (B #05)))]
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
parse error
(program 0.0.0 (lam v (con data (B #05))))
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(program 0.0.0
[[[[[[(force (builtin chooseData))
(con data {Constr 1 [Integer 1]})]
(con data {Constr 1 [Integer 1]})]
(con data {Map [(Integer 0, ByteString #00), (Integer 1, ByteString #0F)]})]
(con data {List [ Integer 0, Integer 1 ]})]
(con data {Integer 2})]
(con data {ByteString #001A})])
(con data (Constr 1 [I 1]))]
(lam x (con integer 1))]
(lam y (con string "two"))]
(lam z3 z3)]
(lam u (con data (I 4)))]
(lam v (con data (B #05)))]
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
parse error
(program 0.0.0 (lam x (con integer 1)))
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(program 0.0.0
[[[[[[(force (builtin chooseData))
(con data {Integer 2})]
(con data {Constr 1 [Integer 1]})]
(con data {Map [(Integer 0, ByteString #00), (Integer 1, ByteString #0F)]})]
(con data {List [ Integer 0, Integer 1 ]})]
(con data {Integer 2})]
(con data {ByteString #001A})])
(con data (I 5))]
(lam x (con integer 1))]
(lam y (con string "two"))]
(lam z3 z3)]
(lam u (con data (I 4)))]
(lam v (con data (B #05)))]
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
parse error
(program 0.0.0 (lam u (con data (I 4))))
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(program 0.0.0
[[[[[[(force (builtin chooseData))
(con data {List [ Integer 0, Integer 1 ]})]
(con data {Constr 1 [Integer 1]})]
(con data {Map [(Integer 0, ByteString #00), (Integer 1, ByteString #0F)]})]
(con data {List [ Integer 0, Integer 1 ]})]
(con data {Integer 2})]
(con data {ByteString #001A})])
(con data (List [I 0, I 1 ]))]
(lam x (con integer 1))]
(lam y (con string "two"))]
(lam z3 z3)]
(lam u (con data (I 4)))]
(lam v (con data (B #05)))]
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
parse error
(program 0.0.0 (lam z3 z3))
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
(program 0.0.0
[[[[[[(force (builtin chooseData))
(con data {Map [(Integer 0, ByteString #00), (Integer 1, ByteString #0F)]})]
(con data {Constr 1 [Integer 1]})]
(con data {Map [(Integer 0, ByteString #00), (Integer 1, ByteString #0F)]})]
(con data {List [ Integer 0, Integer 1 ]})]
(con data {Integer 2})]
(con data {ByteString #001A})])
(con data (Map [(I 0, B #00), (B #0F, I 1)]))]
(lam x (con integer 1))]
(lam y (con string "two"))]
(lam z3 z3)]
(lam u (con data (I 4)))]
(lam v (con data (B #05)))]
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
parse error
(program 0.0.0 (lam y (con string "two")))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(program 1.0.0 [ [ [ (force (builtin ifThenElse)) (con bool True) ] (con integer 0) ] (con integer 1) ])
(program 1.0.0 [ [ [ (force (builtin ifThenElse)) (con bool True) ] (lam x x) ] (con integer 2) ])
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(program 1.0.0 (con integer 0))
(program 1.0.0 (lam x x))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(program 1.0.0
[(force (builtin ifThenElse)) (con bool True) (con integer 23) (con integer 42)]
[(force (builtin ifThenElse)) (con bool False) (lam x x) (lam y (lam z z))]
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(program 1.0.0 (con integer 23))
(program 1.0.0 (lam y (lam z z)))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(program 1.0.0
[(force (builtin ifThenElse)) (con bool False) (con integer 23) (con integer 42)]
[(force (builtin ifThenElse)) (con bool False) (lam x x) (con integer 42)]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 1.0.0 [ [ [ (force (builtin ifThenElse)) (con integer 1) ] (con integer 11) ] (con integer -22) ])
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
evaluation failure
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 1.0.0 [ [ [ (force (builtin ifThenElse)) (lam x (lam y x)) ] (con integer 11) ] (con integer -22) ])
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
evaluation failure

0 comments on commit 6053780

Please sign in to comment.