nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
online_ide: imports nitc (symlinked from contrib)
[nit.git]
/
tests
/
test_serialization.nit
diff --git
a/tests/test_serialization.nit
b/tests/test_serialization.nit
index
59aac77
..
75c7a9d
100644
(file)
--- a/
tests/test_serialization.nit
+++ b/
tests/test_serialization.nit
@@
-14,16
+14,21
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
+#alt2#module test_serialization_alt2 is serialize
+
import serialization
import serialization
-import json_serialization
+import json::serialization
# Simple class
class A
# Simple class
class A
- auto_serializable
+ serialize
+#alt5# serialize
var b = false
var b = false
- var c: Char
- var f: Float
+ var c: Char#alt2#
+ #alt2#var c: Char is noserialize
+ var f: Float#alt4#
+ #alt4#var f: Float is serialize
var i = 123
var s = "asdf"
var n: nullable Int
var i = 123
var s = "asdf"
var n: nullable Int
@@
-43,7
+48,9
@@
end
# Sub-class of A
class B
# Sub-class of A
class B
- auto_serializable
+ auto_serializable#alt2##alt3#
+#alt2# noserialize
+#alt3# noserialize
super A
var ii: Int
super A
var ii: Int
@@
-95,8
+102,9
@@
var d = new D(false, 'b', 123.123, 2345, "new line ->\n<-", null, 1111, "\t\f\"\
d.d = d
for o in new Array[Serializable].with_items(a, b, c, d) do
d.d = d
for o in new Array[Serializable].with_items(a, b, c, d) do
- var stream = new StringOStream
+ var stream = new StringWriter
var serializer = new JsonSerializer(stream)
var serializer = new JsonSerializer(stream)
+ #alt1#serializer.plain_json = true
serializer.serialize(o)
print "# Nit:\n{o}\n"
serializer.serialize(o)
print "# Nit:\n{o}\n"