summaryrefslogtreecommitdiffstats
path: root/src/tests/unit/escape.txt
blob: b65e1b740e44334f13d9f77b93c7f47a25194804 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
#  Like the conditional tests, but tests for escape sequences
#
condition "bob" == 0x626f62
data true

condition 0x == '0x'
data ERROR offset 2 Empty octet string is invalid

condition 'foo' == 0x
data ERROR offset 9 Empty octet string is invalid

# \n gets escaped in double quoted strings
condition "\n" == 0x0a
data true

# but not in single quoted strings
condition '\n' == 0x5c6e
data true

condition '\'' == 0x27
data true

condition "'" == 0x27
data true

condition "\"" == 0x22
data true

condition 0x22 == '"'
data true

condition '\'' == "'"
data true

condition '\\' == "\\"
data true

#
#  The first string is \ + x
#
condition '\x' == "x"
data false

# embedded zeros are OK
condition "a\000a" == 0x610061
data true

condition "aa\000" == 0x616100
data true

condition 'aa\000' == 0x61615c303030
data true

condition 'aa\000' == "aa\000"
data false

condition 'a\n' == "a\n"
data false

condition  0x626f62 == 'bob'
data true

condition  0x626f62 == "bob"
data true

condition  0x626f62 == bob
data true

condition  \n == 0x0a
data ERROR offset 1 Unexpected escape

condition  a\n == 0x610a
data ERROR offset 2 Unexpected escape