Skip to content

Commit 632e4e5

Browse files
committed
Add test cases
1 parent 3b7640c commit 632e4e5

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1+
// Single quotes should not disturb interpolation
12
// Output
2-
// ABC
3-
// c
4-
// '
5-
// ''
6-
// 'ABC'
7-
// a'bABCc'd
83
// '
94
// a'b
5+
// 'ABC
6+
// ABC'
107
// a'bABCc'd
118
// "ab
9+
// ---
10+
// ABC
11+
// c
1212

1313
const str = "ABC"
1414
const space = " "
1515

16-
trust $ printf '{str}\\n' $
17-
trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
18-
echo "'"
19-
echo "''"
20-
echo "'ABC'"
21-
echo "a'b{str}c'd"
2216
trust $ echo "'" $
2317
trust $ echo "a'b" $
18+
trust $ echo "'{str}" $
19+
trust $ echo "{str}'" $
2420
trust $ echo "a'b{str}c'd" $
2521
trust $ echo '"a'b $
22+
echo "---"
23+
// Reallife examples
24+
trust $ printf '{str}\\n' $
25+
trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Single quotes should not disturb interpolation
2+
// Output
3+
// '
4+
// ''
5+
// a'b
6+
// 'ABC'
7+
// a'bABCc'd
8+
// 'ABC
9+
// ABC'
10+
// '"a'b
11+
12+
const str = "ABC"
13+
const space = " "
14+
15+
echo "'"
16+
echo "''"
17+
echo "a'b"
18+
echo "'ABC'"
19+
echo "a'b{str}c'd"
20+
echo "'{str}"
21+
echo "{str}'"
22+
echo "'\"a'b"

0 commit comments

Comments
 (0)