-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathtest-echo.abs
47 lines (43 loc) · 1008 Bytes
/
test-echo.abs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# tests/tests-echo.abs
echo("=====================")
msg = 'echo() mixed LFs and escaped LFs'
ta = 'echo("a\\nb\\nc\n%s\n", "x\ny\nz")'
echo(">>> Testing %s:", msg)
echo("%s", ta)
echo("a\\nb\\nc\n%s\n", "x\ny\nz")
echo("=====================")
msg = 'echo() multiple escapes'
ta = 'echo("hel\\\\lo")'
echo(">>> Testing %s:", msg)
echo("%s", ta)
echo("hel\\\\lo")
echo("=====================")
msg = 'echo() split and join expanded LFs'
ta = 's = split("a\nb\nc", "\n")'
tb = 'echo(s)'
tc = 'ss = join(s, "\n")'
td = 'echo(ss)'
echo(">>> Testing %s:", msg)
echo("%s", ta)
s = split("a\nb\nc", "\n")
echo("%s", tb)
echo(s)
echo("%s", tc)
ss = join(s, "\n")
echo("%s", td)
echo(ss)
echo("=====================")
msg = 'echo split and join with literal LFs'
ta = 's = split(\'a\nb\nc\', \'\n\')'
tb = 'echo(s)'
tc = 'ss = join(s, \'\n\')'
td = 'echo(ss)'
echo(">>> Testing %s:", msg)
echo("%s", ta)
s = split('a\nb\nc', '\n')
echo("%s", tb)
echo(s)
echo("%s", tc)
ss = join(s, '\n')
echo("%s", td)
echo(ss)