We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 938a5f3 commit af3d1e4Copy full SHA for af3d1e4
t/serialization/01-basic.t
@@ -0,0 +1,19 @@
1
+#! nqp
2
+
3
+plan(4);
4
5
+# Serializing an empty SC.
6
+{
7
+ my $sc := pir::nqp_create_sc__Ps('TEST_SC_1_IN');
8
+ my $sh := pir::new__Ps('ResizableStringArray');
9
10
+ my $serialized := pir::nqp_serialize_sc__SPP($sc, $sh);
11
+ ok(nqp::chars($serialized) > 0, 'serialized empty SC to non-empty string');
12
+ ok(nqp::chars($serialized) >= 36, 'output is at least as long as the header');
13
+ ok(nqp::elems($sh) == 0, 'string heap empty with empty SC');
14
15
+ my $dsc := pir::nqp_create_sc__Ps('TEST_SC_1_OUT');
16
+ pir::nqp_deserialize_sc__vSPP($serialized, $dsc, $sh);
17
18
+ ok(nqp::elems($dsc) == 0, 'deserialized SC is also empty');
19
+}
0 commit comments