aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/sed/tests
diff options
context:
space:
mode:
authorMohamed Akram <mohd.akram@outlook.com>2024-12-23 19:06:09 +0000
committerMark Johnston <markj@FreeBSD.org>2024-12-23 19:07:14 +0000
commit5982237f1e5a30b6b7d67b307b4d3685b00718bf (patch)
tree73144a18e32c366c93ff2ef7b9328c6d502ae721 /usr.bin/sed/tests
parent053a988497342a6fd0a717cc097d09c23f83e103 (diff)
Diffstat (limited to 'usr.bin/sed/tests')
-rwxr-xr-xusr.bin/sed/tests/sed2_test.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.bin/sed/tests/sed2_test.sh b/usr.bin/sed/tests/sed2_test.sh
index f50619612561..0b849b1ea132 100755
--- a/usr.bin/sed/tests/sed2_test.sh
+++ b/usr.bin/sed/tests/sed2_test.sh
@@ -159,6 +159,19 @@ minus_e_body()
atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a
}
+atf_test_case command_D
+command_D_head()
+{
+ atf_set "descr" "Test handling of an empty pattern space"
+}
+command_D_body()
+{
+ printf "hello\n\nworld\n" > a
+
+ atf_check -o file:a sed -e 's/^//;P;D' a
+ atf_check -o file:a sed -e 's/^//;$!N;P;D' a
+}
+
atf_init_test_cases()
{
atf_add_test_case inplace_command_q
@@ -169,4 +182,5 @@ atf_init_test_cases()
atf_add_test_case hex_subst
atf_add_test_case bracket_y
atf_add_test_case minus_e
+ atf_add_test_case command_D
}