Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | open Vector |
2 | ||
3 | fun assert(msg,b) = | |
4 | (if b then () | |
5 | else print("assertion failed: " ^ msg ^ "\n")) | |
6 | ||
7 | val v1 = fromList[1,2,3] | |
8 | val v2 = fromList[1,2,3] | |
9 | ||
10 | val _ = 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 | ||
16 | open Array | |
17 | ||
18 | val a1 = fromList[1,2,3] | |
19 | val a2 = fromList[1,2,3] | |
20 | ||
21 | val _ = assert("array equality", a1 <> a2) |