7 REGRESSION_TEST
(`G', `sed G
< regress.
in')
8 REGRESSION_TEST(`P', `sed P < regress.in')
9 REGRESSION_TEST(`psl
', `sed \$!g\;P\;D < regress.in')
10 REGRESSION_TEST
(`bcb', `sed s
/X
/$
(jot -n -bx -s "" 2043)\\\\zz
/ < regress.
in')
11 REGRESSION_TEST(`y', `echo -n foo | sed y/o/O/')
12 REGRESSION_TEST(`sg
', `echo foo | sed s/,*/,/g')
13 REGRESSION_TEST
(`s3', `echo foo |
sed s
/,*/,/3')
14 REGRESSION_TEST(`s4', `echo foo | sed s/,*/,/4')
15 REGRESSION_TEST(`s5
', `echo foo | sed s/,*/,/5')
16 REGRESSION_TEST
(`c0', `sed ''`c\
19 REGRESSION_TEST(`c1', `sed ''`4,$c\
22 REGRESSION_TEST(`c2
', `sed ''`3,9c\
25 REGRESSION_TEST
(`c3', `sed ''`3,/no such string/c\
28 REGRESSION_TEST(`b2a', `sed ''`2,3b
29 1,2d
''` < regress.in')
39 jot -w "l${n}_%d" 9 |
tee lines.
in.
$n lines._in.
$n | \
40 sed "$expr" > lines.out.
$n
41 ins
="$ins lines.in.$n"
42 outs
="$outs lines.out.$n"
43 _ins
="$_ins lines._in.$n"
45 sed "$expr" $_ins > lines.out
47 sed -i "" "$expr" $ins
48 sed -I "" "$expr" $_ins
51 diff -u lines.out.
$n lines.
in.
$n || rc
=1
53 cat $_ins |
diff -u lines.out
- || rc
=1
54 rm -f $ins $outs $_ins lines.out
60 REGRESSION_TEST_FREEFORM(`inplace1', `inplace_test 3,6d')
61 REGRESSION_TEST_FREEFORM(`inplace2
', `inplace_test 8,30d')
62 REGRESSION_TEST_FREEFORM
(`inplace3', `inplace_test
20,99d
')
63 REGRESSION_TEST_FREEFORM(`inplace4', `inplace_test "{;{;8,30d;};}"')
64 REGRESSION_TEST_FREEFORM(`inplace5
', `inplace_test "3x;6G"')
66 REGRESSION_TEST
(`icase1', `sed /SED
/Id
< regress.
in')
67 REGRESSION_TEST(`icase2', `sed s/SED/Foo/I < regress.in')
68 REGRESSION_TEST(`icase3
', `sed s/SED/Foo/ < regress.in')
70 REGRESSION_TEST
(`hanoi', `echo ":abcd: : :" |
sed -f hanoi.
sed')
71 REGRESSION_TEST(`math', `echo "4+7*3+2^7/3" | sed -f math.sed')