Import Upstream version 20180207
[hcoop/debian/mlton.git] / regression / string.fromString.sml
CommitLineData
7f918cf1
CE
1fun check (s, s') =
2 case String.fromString s of
3 NONE => print "WRONG NONE\n"
4 | SOME s'' =>
5 if s' = s''
6 then print (concat ["OK [", s', "]\n"])
7 else print (concat ["WRONG [", s', "] [", s'', "]\n"])
8
9val _ =
10 List.app check
11 [("abc\"def", "abc"),
12 ("\\q", ""),
13 ("a\^D", "a"),
14 ("a\\ \\\\q", "a"),
15 ("\\ \\", ""),
16 ("", ""),
17 ("\\ \\\^D", ""),
18 ("\\ a", "")]