Commit 264df6940998998f13636d2fec055d520a270eb5

Thomas de Grivel 2024-07-29T14:27:35

fix tests for (U8) 0

diff --git a/test/ikc3/def.out.expected b/test/ikc3/def.out.expected
index f8b5f99..d144801 100644
--- a/test/ikc3/def.out.expected
+++ b/test/ikc3/def.out.expected
@@ -1,19 +1,19 @@
-def zero = 0
+def zero = (U8) 0
 zero
 zero
-0
-def one_two_three = [1, 2, 3]
+(U8) 0
+def one_two_three = [(U8) 1, (U8) 2, (U8) 3]
 one_two_three
 one_two_three
-[1, 2, 3]
-def double = fn (x) { x * 2 }
+[(U8) 1, (U8) 2, (U8) 3]
+def double = fn (x) { x * (U8) 2 }
 double
 double
-fn (x) { x * 2 }
-double(200)
-400
+fn (x) { x * (U8) 2 }
+double((U8) 200)
+(U16) 400
 double(zero)
-0
+(U16) 0
 def double_tuple = macro (x) do
   quote do
   x = ^ unquote(x)
@@ -28,12 +28,12 @@ macro (x) do
   {x, x}
 end
 end
-double_tuple(200)
-{200, 200}
+double_tuple((U8) 200)
+{(U8) 200, (U8) 200}
 double_tuple(zero)
-{0, 0}
+{(U8) 0, (U8) 0}
 double_tuple(one_two_three)
-{[1, 2, 3], [1, 2, 3]}
+{[(U8) 1, (U8) 2, (U8) 3], [(U8) 1, (U8) 2, (U8) 3]}
 def reverse = fn {
   (x) { reverse(x, []) }
   ([], acc) { acc }
@@ -46,8 +46,8 @@ fn {
   ([], acc) { acc }
   ([a | b], acc) { reverse(b, [a | acc]) }
 }
-reverse([1, 2, 3])
-[3, 2, 1]
+reverse([(U8) 1, (U8) 2, (U8) 3])
+[(U8) 3, (U8) 2, (U8) 1]
 def reverse = fn {
   (x) { reverse(x, []) }
   ([], acc) { [:reversed | acc] }
@@ -60,8 +60,8 @@ fn {
   ([], acc) { [:reversed | acc] }
   ([a | b], acc) { reverse(b, [a | acc]) }
 }
-reverse([1, 2, 3])
-[:reversed, 3, 2, 1]
+reverse([(U8) 1, (U8) 2, (U8) 3])
+[:reversed, (U8) 3, (U8) 2, (U8) 1]
 def reverse = fn {
   (x) { reverse(x, []) }
   ([], acc) { acc }
@@ -74,14 +74,14 @@ fn {
   ([], acc) { acc }
   ([a | b], acc) { reverse(b, [a | acc]) }
 }
-reverse([1, 2, 3])
-[3, 2, 1]
+reverse([(U8) 1, (U8) 2, (U8) 3])
+[(U8) 3, (U8) 2, (U8) 1]
 def reverse = fn (x) { List.reverse(x) }
 reverse
 reverse
 fn (x) { List.reverse(x) }
-reverse([1, 2, 3])
-[3, 2, 1]
+reverse([(U8) 1, (U8) 2, (U8) 3])
+[(U8) 3, (U8) 2, (U8) 1]
 module()
 KC3
 search_modules()
@@ -92,8 +92,8 @@ def reverse = fn (x) { [:reversed | List.reverse(x)] }
 reverse
 reverse
 fn (x) { [:reversed | List.reverse(x)] }
-reverse([1, 2, 3])
-[:reversed, 3, 2, 1]
+reverse([(U8) 1, (U8) 2, (U8) 3])
+[:reversed, (U8) 3, (U8) 2, (U8) 1]
 module()
 KC3
 search_modules()
@@ -104,8 +104,8 @@ def reverse = fn (x) { List.reverse(x) }
 reverse
 reverse
 fn (x) { List.reverse(x) }
-reverse([1, 2, 3])
-[3, 2, 1]
+reverse([(U8) 1, (U8) 2, (U8) 3])
+[(U8) 3, (U8) 2, (U8) 1]
 module()
 KC3
 search_modules()
diff --git a/test/ikc3/list.out.expected b/test/ikc3/list.out.expected
index 7837778..774ba29 100644
--- a/test/ikc3/list.out.expected
+++ b/test/ikc3/list.out.expected
@@ -20,7 +20,7 @@
 [:a, :b, :c, :d]
 [:a, :b, :c | :d]
 [:a, :b, :c | :d]
-List.map([1, 2, 3, 4], fn (x) { x * 2 })
-[2, 4, 6, 8]
-List.reverse([1, 2, 3, 4])
-[4, 3, 2, 1]
+List.map([(U8) 1, (U8) 2, (U8) 3, (U8) 4], fn (x) { x * (U8) 2 })
+[(U16) 2, (U16) 4, (U16) 6, (U16) 8]
+List.reverse([(U8) 1, (U8) 2, (U8) 3, (U8) 4])
+[(U8) 4, (U8) 3, (U8) 2, (U8) 1]