HCoop
/
hcoop
/
debian
/
mlton.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Import Upstream version 20180207
[hcoop/debian/mlton.git]
/
regression
/
string.fromString.sml
1
fun
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
9
val
_
=
10
List
.
app check
11
[(
"abc
\"
def"
,
"abc"
),
12
(
"
\\
q"
,
""
),
13
(
"a\^D"
,
"a"
),
14
(
"a
\\ \\\\
q"
,
"a"
),
15
(
"
\\ \\
"
,
""
),
16
(
""
,
""
),
17
(
"
\\ \\
\^D"
,
""
),
18
(
"
\\
a"
,
""
)]