summaryrefslogtreecommitdiff
path: root/testsuite/sed
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/sed')
-rw-r--r--testsuite/sed/sed-chains-substs1
-rw-r--r--testsuite/sed/sed-handles-embedded-slashes1
-rw-r--r--testsuite/sed/sed-handles-empty-lines1
-rw-r--r--testsuite/sed/sed-handles-unsatisfied-backrefs6
-rw-r--r--testsuite/sed/sed-prints-line-once-for-multiple-substs4
5 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/sed/sed-chains-substs b/testsuite/sed/sed-chains-substs
new file mode 100644
index 0000000..266936a
--- /dev/null
+++ b/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/testsuite/sed/sed-handles-embedded-slashes b/testsuite/sed/sed-handles-embedded-slashes
new file mode 100644
index 0000000..cc28761
--- /dev/null
+++ b/testsuite/sed/sed-handles-embedded-slashes
@@ -0,0 +1 @@
+test "$(echo fu/bar | busybox sed -e 's/[/]//')" = fubar
diff --git a/testsuite/sed/sed-handles-empty-lines b/testsuite/sed/sed-handles-empty-lines
new file mode 100644
index 0000000..2bb8f04
--- /dev/null
+++ b/testsuite/sed/sed-handles-empty-lines
@@ -0,0 +1 @@
+test `echo | busybox sed -e 's/$/@/'` = @
diff --git a/testsuite/sed/sed-handles-unsatisfied-backrefs b/testsuite/sed/sed-handles-unsatisfied-backrefs
new file mode 100644
index 0000000..61bff88
--- /dev/null
+++ b/testsuite/sed/sed-handles-unsatisfied-backrefs
@@ -0,0 +1,6 @@
+busybox sed -e 's/.*root=/\1/' >output <<EOF
+BOOT_IMAGE=vmlinuz root=/dev/hda5 initrd=init1
+EOF
+cmp -s output - <<EOF
+/dev/hda5 initrd=init1
+EOF
diff --git a/testsuite/sed/sed-prints-line-once-for-multiple-substs b/testsuite/sed/sed-prints-line-once-for-multiple-substs
new file mode 100644
index 0000000..ba8955d
--- /dev/null
+++ b/testsuite/sed/sed-prints-line-once-for-multiple-substs
@@ -0,0 +1,4 @@
+busybox sed -e s/1/2/g -e s/3/4/g >output <<EOF
+1
+EOF
+echo 2 | cmp -s output -