Import Upstream version 20180207
[hcoop/debian/mlton.git] / regression / vector4.sml
CommitLineData
7f918cf1
CE
1open Vector
2
3fun assert(msg,b) =
4 (if b then ()
5 else print("assertion failed: " ^ msg ^ "\n"))
6
7val v1 = fromList[1,2,3]
8val v2 = fromList[1,2,3]
9
10val _ = assert("vector equality",
11 v1 = v2
12 andalso fromList[v1, v2] = fromList[v2, v1]
13 andalso v1 <> fromList[1,2]
14 andalso v1 <> fromList[1,2,4])
15
16open Array
17
18val a1 = fromList[1,2,3]
19val a2 = fromList[1,2,3]
20
21val _ = assert("array equality", a1 <> a2)