diff options
author | nobody <nobody@localhost> | 2004-10-13 09:42:10 +0000 |
---|---|---|
committer | nobody <nobody@localhost> | 2004-10-13 09:42:10 +0000 |
commit | 8c59a0bf0e9e2d87b0ff273ea3f0bf05bbbf6373 (patch) | |
tree | 1826706cd4fd009fcd14f4f8021005ec8ec0fa59 /busybox/testsuite/sed | |
download | busybox-w32-8c59a0bf0e9e2d87b0ff273ea3f0bf05bbbf6373.tar.gz busybox-w32-8c59a0bf0e9e2d87b0ff273ea3f0bf05bbbf6373.tar.bz2 busybox-w32-8c59a0bf0e9e2d87b0ff273ea3f0bf05bbbf6373.zip |
This commit was manufactured by cvs2svn to create tag 'busybox_1_00'.
Diffstat (limited to 'busybox/testsuite/sed')
21 files changed, 262 insertions, 0 deletions
diff --git a/busybox/testsuite/sed/sed-accepts-blanks-before-command b/busybox/testsuite/sed/sed-accepts-blanks-before-command new file mode 100644 index 000000000..9597c2f8b --- /dev/null +++ b/busybox/testsuite/sed/sed-accepts-blanks-before-command | |||
@@ -0,0 +1 @@ | |||
busybox sed -e '1 d' </dev/null | |||
diff --git a/busybox/testsuite/sed/sed-aic-commands b/busybox/testsuite/sed/sed-aic-commands new file mode 100644 index 000000000..b41c14ab8 --- /dev/null +++ b/busybox/testsuite/sed/sed-aic-commands | |||
@@ -0,0 +1,134 @@ | |||
1 | cat - >input <<EOF | ||
2 | 2i\\ | ||
3 | before 2 | ||
4 | 5c\\ | ||
5 | Change 5 | ||
6 | 10a\\ | ||
7 | After 10 | ||
8 | 22i\\ | ||
9 | before 22\\ | ||
10 | Continued | ||
11 | 25c\\ | ||
12 | Change 25\\ | ||
13 | Continued | ||
14 | 20a\\ | ||
15 | After 20\\ | ||
16 | Continued | ||
17 | 32i\\ | ||
18 | before 32\\ | ||
19 | Continued 1\\ | ||
20 | Continued 2\\ | ||
21 | Continued 3 | ||
22 | 35c\\ | ||
23 | Change 35\\ | ||
24 | Continued 1\\ | ||
25 | Continued 2\\ | ||
26 | Continued 3 | ||
27 | 30a\\ | ||
28 | After 30\\ | ||
29 | Continued 1\\ | ||
30 | Continued 2\\ | ||
31 | Continued 3 | ||
32 | EOF | ||
33 | busybox sed -f input >output <<EOF | ||
34 | 1 y | ||
35 | 2 y | ||
36 | 3 y | ||
37 | 4 y | ||
38 | 5 y | ||
39 | 6 y | ||
40 | 7 y | ||
41 | 8 y | ||
42 | 9 y | ||
43 | 10 y | ||
44 | 11 y | ||
45 | 12 y | ||
46 | 13 y | ||
47 | 14 y | ||
48 | 15 y | ||
49 | 16 y | ||
50 | 17 y | ||
51 | 18 y | ||
52 | 19 y | ||
53 | 20 y | ||
54 | 21 y | ||
55 | 22 y | ||
56 | 23 y | ||
57 | 24 y | ||
58 | 25 y | ||
59 | 26 y | ||
60 | 27 y | ||
61 | 28 y | ||
62 | 29 y | ||
63 | 30 y | ||
64 | 31 y | ||
65 | 32 y | ||
66 | 33 y | ||
67 | 34 y | ||
68 | 35 y | ||
69 | 36 y | ||
70 | 37 y | ||
71 | 38 y | ||
72 | 39 y | ||
73 | 40 y | ||
74 | EOF | ||
75 | cmp -s output - <<EOF | ||
76 | 1 y | ||
77 | before 2 | ||
78 | 2 y | ||
79 | 3 y | ||
80 | 4 y | ||
81 | Change 5 | ||
82 | 6 y | ||
83 | 7 y | ||
84 | 8 y | ||
85 | 9 y | ||
86 | 10 y | ||
87 | After 10 | ||
88 | 11 y | ||
89 | 12 y | ||
90 | 13 y | ||
91 | 14 y | ||
92 | 15 y | ||
93 | 16 y | ||
94 | 17 y | ||
95 | 18 y | ||
96 | 19 y | ||
97 | 20 y | ||
98 | After 20 | ||
99 | Continued | ||
100 | 21 y | ||
101 | before 22 | ||
102 | Continued | ||
103 | 22 y | ||
104 | 23 y | ||
105 | 24 y | ||
106 | Change 25 | ||
107 | Continued | ||
108 | 26 y | ||
109 | 27 y | ||
110 | 28 y | ||
111 | 29 y | ||
112 | 30 y | ||
113 | After 30 | ||
114 | Continued 1 | ||
115 | Continued 2 | ||
116 | Continued 3 | ||
117 | 31 y | ||
118 | before 32 | ||
119 | Continued 1 | ||
120 | Continued 2 | ||
121 | Continued 3 | ||
122 | 32 y | ||
123 | 33 y | ||
124 | 34 y | ||
125 | Change 35 | ||
126 | Continued 1 | ||
127 | Continued 2 | ||
128 | Continued 3 | ||
129 | 36 y | ||
130 | 37 y | ||
131 | 38 y | ||
132 | 39 y | ||
133 | 40 y | ||
134 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-append-hold-space-to-pattern-space b/busybox/testsuite/sed/sed-append-hold-space-to-pattern-space new file mode 100644 index 000000000..6dda80fee --- /dev/null +++ b/busybox/testsuite/sed/sed-append-hold-space-to-pattern-space | |||
@@ -0,0 +1,13 @@ | |||
1 | busybox sed 'G'>output <<EOF | ||
2 | a | ||
3 | b | ||
4 | c | ||
5 | EOF | ||
6 | cmp -s output - <<EOF | ||
7 | a | ||
8 | |||
9 | b | ||
10 | |||
11 | c | ||
12 | |||
13 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-append-next-line b/busybox/testsuite/sed/sed-append-next-line new file mode 100644 index 000000000..0621a319f --- /dev/null +++ b/busybox/testsuite/sed/sed-append-next-line | |||
@@ -0,0 +1,19 @@ | |||
1 | # This will fail if CONFIG_FEATURE_SED_GNU_COMPATABILITY is defined | ||
2 | busybox sed 'N;p'>output <<EOF | ||
3 | a | ||
4 | b | ||
5 | c | ||
6 | EOF | ||
7 | |||
8 | set +e | ||
9 | cmp -s output - <<EOF | ||
10 | a | ||
11 | b | ||
12 | a | ||
13 | b | ||
14 | c | ||
15 | EOF | ||
16 | if [ $? != 0 ] ; then | ||
17 | exit 0; | ||
18 | fi | ||
19 | exit 1; | ||
diff --git a/busybox/testsuite/sed/sed-branch b/busybox/testsuite/sed/sed-branch new file mode 100644 index 000000000..4167569ad --- /dev/null +++ b/busybox/testsuite/sed/sed-branch | |||
@@ -0,0 +1 @@ | |||
test "$(echo foo | busybox sed 'b one;p;: one')" = foo | |||
diff --git a/busybox/testsuite/sed/sed-branch-conditional b/busybox/testsuite/sed/sed-branch-conditional new file mode 100644 index 000000000..47d0a5ff2 --- /dev/null +++ b/busybox/testsuite/sed/sed-branch-conditional | |||
@@ -0,0 +1,15 @@ | |||
1 | busybox sed 's/a/1/;t one;p;: one;p'>output <<EOF | ||
2 | a | ||
3 | b | ||
4 | c | ||
5 | EOF | ||
6 | cmp -s output - <<EOF | ||
7 | 1 | ||
8 | 1 | ||
9 | b | ||
10 | b | ||
11 | b | ||
12 | c | ||
13 | c | ||
14 | c | ||
15 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-branch-conditional2 b/busybox/testsuite/sed/sed-branch-conditional2 new file mode 100644 index 000000000..f4b11f0f8 --- /dev/null +++ b/busybox/testsuite/sed/sed-branch-conditional2 | |||
@@ -0,0 +1,11 @@ | |||
1 | #XFAIL | ||
2 | busybox sed 's/a/b/;:loop;t loop'>output <<EOF | ||
3 | a | ||
4 | b | ||
5 | c | ||
6 | EOF | ||
7 | cmp -s output - <<EOF | ||
8 | b | ||
9 | b | ||
10 | c | ||
11 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-branch-no-label b/busybox/testsuite/sed/sed-branch-no-label new file mode 100644 index 000000000..446c1bcd9 --- /dev/null +++ b/busybox/testsuite/sed/sed-branch-no-label | |||
@@ -0,0 +1 @@ | |||
test "$(echo foo | busybox sed 'b;p')" = foo | |||
diff --git a/busybox/testsuite/sed/sed-chains-substs b/busybox/testsuite/sed/sed-chains-substs new file mode 100644 index 000000000..266936ac4 --- /dev/null +++ b/busybox/testsuite/sed/sed-chains-substs | |||
@@ -0,0 +1 @@ | |||
test "$(echo foo | busybox sed -e s/foo/bar/ -e s/bar/baz/)" = baz | |||
diff --git a/busybox/testsuite/sed/sed-chains-substs2 b/busybox/testsuite/sed/sed-chains-substs2 new file mode 100644 index 000000000..90568f6e6 --- /dev/null +++ b/busybox/testsuite/sed/sed-chains-substs2 | |||
@@ -0,0 +1 @@ | |||
test x"$(echo foo | busybox -n sed -e s/foo/bar/ -e s/foo/baz/)" = x | |||
diff --git a/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line b/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line new file mode 100644 index 000000000..6f106e104 --- /dev/null +++ b/busybox/testsuite/sed/sed-does-not-substitute-in-deleted-line | |||
@@ -0,0 +1,2 @@ | |||
1 | echo foo | busybox sed -e /foo/d -e s/foo/bar/ >foo | ||
2 | cmp foo /dev/null | ||
diff --git a/busybox/testsuite/sed/sed-handles-embedded-slashes b/busybox/testsuite/sed/sed-handles-embedded-slashes new file mode 100644 index 000000000..cc287613d --- /dev/null +++ b/busybox/testsuite/sed/sed-handles-embedded-slashes | |||
@@ -0,0 +1 @@ | |||
test "$(echo fu/bar | busybox sed -e 's/[/]//')" = fubar | |||
diff --git a/busybox/testsuite/sed/sed-handles-empty-lines b/busybox/testsuite/sed/sed-handles-empty-lines new file mode 100644 index 000000000..2bb8f045a --- /dev/null +++ b/busybox/testsuite/sed/sed-handles-empty-lines | |||
@@ -0,0 +1 @@ | |||
test `echo | busybox sed -e 's/$/@/'` = @ | |||
diff --git a/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs b/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs new file mode 100644 index 000000000..61bff8837 --- /dev/null +++ b/busybox/testsuite/sed/sed-handles-unsatisfied-backrefs | |||
@@ -0,0 +1,6 @@ | |||
1 | busybox sed -e 's/.*root=/\1/' >output <<EOF | ||
2 | BOOT_IMAGE=vmlinuz root=/dev/hda5 initrd=init1 | ||
3 | EOF | ||
4 | cmp -s output - <<EOF | ||
5 | /dev/hda5 initrd=init1 | ||
6 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-next-line b/busybox/testsuite/sed/sed-next-line new file mode 100644 index 000000000..38fe20cf2 --- /dev/null +++ b/busybox/testsuite/sed/sed-next-line | |||
@@ -0,0 +1,12 @@ | |||
1 | busybox sed 'n;p'>output <<EOF | ||
2 | a | ||
3 | b | ||
4 | c | ||
5 | EOF | ||
6 | cmp -s output - <<EOF | ||
7 | a | ||
8 | b | ||
9 | b | ||
10 | c | ||
11 | c | ||
12 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs b/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs new file mode 100644 index 000000000..ba8955d6e --- /dev/null +++ b/busybox/testsuite/sed/sed-prints-line-once-for-multiple-substs | |||
@@ -0,0 +1,4 @@ | |||
1 | busybox sed -e s/1/2/g -e s/3/4/g >output <<EOF | ||
2 | 1 | ||
3 | EOF | ||
4 | echo 2 | cmp -s output - | ||
diff --git a/busybox/testsuite/sed/sed-recurses-properly b/busybox/testsuite/sed/sed-recurses-properly new file mode 100644 index 000000000..a02667b41 --- /dev/null +++ b/busybox/testsuite/sed/sed-recurses-properly | |||
@@ -0,0 +1 @@ | |||
test "`echo '12345' | busybox sed -e 's/[[:space:]]*/,/g')` = ',1,2,3,4,5,'" | |||
diff --git a/busybox/testsuite/sed/sed-regex-match-newline b/busybox/testsuite/sed/sed-regex-match-newline new file mode 100644 index 000000000..1057e1718 --- /dev/null +++ b/busybox/testsuite/sed/sed-regex-match-newline | |||
@@ -0,0 +1,10 @@ | |||
1 | # FEATURE: CONFIG_FEATURE_SED_EMBEDED_NEWLINE | ||
2 | busybox sed -n 'N;/a\nb/p'>output <<EOF | ||
3 | a | ||
4 | b | ||
5 | c | ||
6 | EOF | ||
7 | cmp -s output - <<EOF | ||
8 | a | ||
9 | b | ||
10 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line b/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line new file mode 100644 index 000000000..6421fa552 --- /dev/null +++ b/busybox/testsuite/sed/sed-splits-edit-commands-on-command-line | |||
@@ -0,0 +1,9 @@ | |||
1 | echo 2 | busybox sed -e 'i\ | ||
2 | 1 | ||
3 | a\ | ||
4 | 3' > output | ||
5 | cmp output - <<EOF | ||
6 | 1 | ||
7 | 2 | ||
8 | 3 | ||
9 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-subst-subprint b/busybox/testsuite/sed/sed-subst-subprint new file mode 100644 index 000000000..24f8bad7d --- /dev/null +++ b/busybox/testsuite/sed/sed-subst-subprint | |||
@@ -0,0 +1,9 @@ | |||
1 | busybox sed 's/foo/bar/p'>output <<EOF | ||
2 | foo | ||
3 | bar | ||
4 | EOF | ||
5 | cmp -s output - <<EOF | ||
6 | bar | ||
7 | bar | ||
8 | bar | ||
9 | EOF | ||
diff --git a/busybox/testsuite/sed/sed-write-to-stdout b/busybox/testsuite/sed/sed-write-to-stdout new file mode 100644 index 000000000..95b4d724b --- /dev/null +++ b/busybox/testsuite/sed/sed-write-to-stdout | |||
@@ -0,0 +1,10 @@ | |||
1 | busybox sed -n 'N;P;p'>output <<EOF | ||
2 | a | ||
3 | b | ||
4 | c | ||
5 | EOF | ||
6 | cmp -s output - <<EOF | ||
7 | a | ||
8 | a | ||
9 | b | ||
10 | EOF | ||