tests: report deserialization errors
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 4 Aug 2016 14:40:05 +0000 (10:40 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 4 Aug 2016 16:26:26 +0000 (12:26 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

tests/sav/nitce/test_json_deserialization_alt1.res
tests/sav/nitce/test_json_deserialization_alt3.res
tests/test_json_deserialization.nit

index dd26cc0..9c63bff 100644 (file)
 # Back in Nit:
 <E: a: hello, 1234, 123.4; b: hella, 2345, 234.5>
 
+Deserialization Error: Doesn't know how to deserialize class "Array"
+Deserialization Error: Wrong type on `E::a` expected `Unknown type`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "Array"
+Deserialization Error: Wrong type on `E::b` expected `Unknown type`, got `null`
 # Nit:
 <E: 2222>
 
@@ -54,6 +58,7 @@
 # Back in Nit:
 null
 
+Deserialization Error: Doesn't know how to deserialize class "F"
 # Nit:
 <E: 33.33>
 
@@ -63,6 +68,7 @@ null
 # Back in Nit:
 null
 
+Deserialization Error: Doesn't know how to deserialize class "F"
 # Nit:
 <G: hs: -1, 0; s: one, two; hm: one. 1, two. 2; am: three. 3, four. 4>
 
@@ -72,3 +78,11 @@ null
 # Back in Nit:
 <G: hs: ; s: ; hm: ; am: >
 
+Deserialization Error: Doesn't know how to deserialize class "HashSet"
+Deserialization Error: Wrong type on `G::hs` expected `Unknown type`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "ArraySet"
+Deserialization Error: Wrong type on `G::s` expected `Set[String]`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "HashMap"
+Deserialization Error: Wrong type on `G::hm` expected `Unknown type`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "ArrayMap"
+Deserialization Error: Wrong type on `G::am` expected `Unknown type`, got `null`
index b269caf..fe41ba6 100644 (file)
 # Back in Nit:
 <E: a: hello, 1234, 123.4; b: hella, 2345, 234.5>
 
+Deserialization Error: Doesn't know how to deserialize class "Array"
+Deserialization Error: Wrong type on `E::a` expected `Unknown type`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "Array"
+Deserialization Error: Wrong type on `E::b` expected `Unknown type`, got `null`
 # Nit:
 <E: 2222>
 
 # Back in Nit:
 null
 
+Deserialization Error: Doesn't know how to deserialize class "F"
 # Nit:
 <E: 33.33>
 
@@ -143,6 +148,7 @@ null
 # Back in Nit:
 null
 
+Deserialization Error: Doesn't know how to deserialize class "F"
 # Nit:
 <G: hs: -1, 0; s: one, two; hm: one. 1, two. 2; am: three. 3, four. 4>
 
@@ -190,3 +196,11 @@ null
 # Back in Nit:
 <G: hs: ; s: ; hm: ; am: >
 
+Deserialization Error: Doesn't know how to deserialize class "HashSet"
+Deserialization Error: Wrong type on `G::hs` expected `Unknown type`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "ArraySet"
+Deserialization Error: Wrong type on `G::s` expected `Set[String]`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "HashMap"
+Deserialization Error: Wrong type on `G::hm` expected `Unknown type`, got `null`
+Deserialization Error: Doesn't know how to deserialize class "ArrayMap"
+Deserialization Error: Wrong type on `G::am` expected `Unknown type`, got `null`
index 6a06550..6b936ac 100644 (file)
@@ -40,4 +40,5 @@ for o in tests do
        print "# Nit:\n{o}\n"
        print "# Json:\n{stream}\n"
        print "# Back in Nit:\n{deserialized or else "null"}\n"#alt2##alt4#
+       if deserializer.errors.not_empty then print deserializer.errors.join("\n")#alt2##alt4#
 end