]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Serialization.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Serialization.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Serialization.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Serialization.scl
new file mode 100644 (file)
index 0000000..e0d44e3
--- /dev/null
@@ -0,0 +1,14 @@
+import "Prelude"
+
+rt :: Serializable a => a -> a
+rt v = deserialize (serialize v)
+
+main :: String
+main = show (
+  (rt "Hello", rt ()),
+  (rt 1.2 :: Double, rt 1.2 :: Float, 3 :: Integer, 4 :: Long),
+  rt (Just (1 :: Integer)),
+  (rt [1::Integer,2,3], rt [[1::Integer,2],[3,4]], fromDoubleArray (rt (toDoubleArray [3::Double,2,1])))
+  )
+--
+(("Hello", ()), (1.2, 1.2, 3, 4), Just 1, ([1, 2, 3], [[1, 2], [3, 4]], [3.0, 2.0, 1.0]))
\ No newline at end of file