diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/dynamic_test.gleam | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/test/gleam/dynamic_test.gleam b/test/gleam/dynamic_test.gleam index abf4ce6..936be49 100644 --- a/test/gleam/dynamic_test.gleam +++ b/test/gleam/dynamic_test.gleam @@ -511,7 +511,7 @@ pub fn tuple2_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "Tuple of 2 elements", + expected: "Tuple or List of 2 elements", found: "Tuple of 3 elements", ), ])) @@ -520,7 +520,7 @@ pub fn tuple2_test() { |> dynamic.from |> dynamic.tuple2(dynamic.int, dynamic.int) |> should.equal(Error([ - DecodeError(path: [], expected: "Tuple of 2 elements", found: "Int"), + DecodeError(path: [], expected: "Tuple or List of 2 elements", found: "Int"), ])) [1, 2] @@ -547,8 +547,19 @@ pub fn tuple2_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "List of 2 elements", - found: "List of 3 elements", + expected: "Tuple or List of 2 elements", + found: "List", + ), + ])) + + [] + |> dynamic.from + |> dynamic.tuple2(dynamic.int, dynamic.int) + |> should.equal(Error([ + DecodeError( + path: [], + expected: "Tuple or List of 2 elements", + found: "List", ), ])) } @@ -596,7 +607,7 @@ pub fn tuple3_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "Tuple of 3 elements", + expected: "Tuple or List of 3 elements", found: "Tuple of 2 elements", ), ])) @@ -616,8 +627,8 @@ pub fn tuple3_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "List of 3 elements", - found: "List of 2 elements", + expected: "Tuple or List of 3 elements", + found: "List", ), ])) @@ -625,7 +636,7 @@ pub fn tuple3_test() { |> dynamic.from |> dynamic.tuple3(dynamic.int, dynamic.int, dynamic.int) |> should.equal(Error([ - DecodeError(path: [], expected: "Tuple of 3 elements", found: "Int"), + DecodeError(path: [], expected: "Tuple or List of 3 elements", found: "Int"), ])) } @@ -673,7 +684,7 @@ pub fn tuple4_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "Tuple of 4 elements", + expected: "Tuple or List of 4 elements", found: "Tuple of 2 elements", ), ])) @@ -694,8 +705,8 @@ pub fn tuple4_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "List of 4 elements", - found: "List of 2 elements", + expected: "Tuple or List of 4 elements", + found: "List", ), ])) @@ -703,7 +714,7 @@ pub fn tuple4_test() { |> dynamic.from |> dynamic.tuple4(dynamic.int, dynamic.int, dynamic.int, dynamic.int) |> should.equal(Error([ - DecodeError(path: [], expected: "Tuple of 4 elements", found: "Int"), + DecodeError(path: [], expected: "Tuple or List of 4 elements", found: "Int"), ])) } @@ -800,7 +811,7 @@ pub fn tuple5_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "Tuple of 5 elements", + expected: "Tuple or List of 5 elements", found: "Tuple of 2 elements", ), ])) @@ -834,8 +845,8 @@ pub fn tuple5_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "List of 5 elements", - found: "List of 2 elements", + expected: "Tuple or List of 5 elements", + found: "List", ), ])) @@ -849,7 +860,7 @@ pub fn tuple5_test() { dynamic.int, ) |> should.equal(Error([ - DecodeError(path: [], expected: "Tuple of 5 elements", found: "Int"), + DecodeError(path: [], expected: "Tuple or List of 5 elements", found: "Int"), ])) } @@ -955,7 +966,7 @@ pub fn tuple6_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "Tuple of 6 elements", + expected: "Tuple or List of 6 elements", found: "Tuple of 2 elements", ), ])) @@ -992,8 +1003,8 @@ pub fn tuple6_test() { |> should.equal(Error([ DecodeError( path: [], - expected: "List of 6 elements", - found: "List of 2 elements", + expected: "Tuple or List of 6 elements", + found: "List", ), ])) @@ -1008,7 +1019,7 @@ pub fn tuple6_test() { dynamic.int, ) |> should.equal(Error([ - DecodeError(path: [], expected: "Tuple of 6 elements", found: "Int"), + DecodeError(path: [], expected: "Tuple or List of 6 elements", found: "Int"), ])) } |