Skip to content

Commit 25096ba

Browse files
committed
Add test cases
1 parent 3b7640c commit 25096ba

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
// Output
2-
// ABC
3-
// c
42
// '
53
// ''
4+
// a'b
65
// 'ABC'
76
// a'bABCc'd
7+
// 'ABC
8+
// ABC'
9+
// '"a'b
10+
// ---
811
// '
912
// a'b
13+
// 'ABC
14+
// ABC'
1015
// a'bABCc'd
1116
// "ab
17+
// ---
18+
// ABC
19+
// c
1220

1321
const str = "ABC"
1422
const space = " "
1523

16-
trust $ printf '{str}\\n' $
17-
trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
1824
echo "'"
1925
echo "''"
26+
echo "a'b"
2027
echo "'ABC'"
2128
echo "a'b{str}c'd"
29+
echo "'{str}"
30+
echo "{str}'"
31+
echo "'\"a'b"
32+
echo "---"
2233
trust $ echo "'" $
2334
trust $ echo "a'b" $
35+
trust $ echo "'{str}" $
36+
trust $ echo "{str}'" $
2437
trust $ echo "a'b{str}c'd" $
2538
trust $ echo '"a'b $
39+
echo "---"
40+
// Reallife examples
41+
trust $ printf '{str}\\n' $
42+
trust $ echo 'a b c d e' | cut -d'{space}' -f3 $

0 commit comments

Comments
 (0)