Deleted Added
full compact
multi_test.sh (17523) multi_test.sh (117900)
1#!/bin/sh -
2#
3# Copyright (c) 1992 Diomidis Spinellis.
4# Copyright (c) 1992, 1993
5# The Regents of the University of California. All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions

--- 20 unchanged lines hidden (view full) ---

29# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33# SUCH DAMAGE.
34#
35# @(#)sed.test 8.1 (Berkeley) 6/6/93
36#
1#!/bin/sh -
2#
3# Copyright (c) 1992 Diomidis Spinellis.
4# Copyright (c) 1992, 1993
5# The Regents of the University of California. All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions

--- 20 unchanged lines hidden (view full) ---

29# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33# SUCH DAMAGE.
34#
35# @(#)sed.test 8.1 (Berkeley) 6/6/93
36#
37# $FreeBSD: head/tools/regression/usr.bin/sed/multitest.t 117900 2003-07-22 19:22:08Z dds $
38#
37
38# sed Regression Tests
39#
40# The following files are created:
41# lines[1-4], script1, script2
42# Two directories *.out contain the test results
43
44main()

--- 380 unchanged lines hidden (view full) ---

425
426test_print()
427{
428 echo Testing print and file routines
429 awk 'END {for (i = 1; i < 256; i++) printf("%c", i);print "\n"}' \
430 </dev/null >lines3
431 # GNU and SunOS sed behave differently here
432 mark '7.1'
39
40# sed Regression Tests
41#
42# The following files are created:
43# lines[1-4], script1, script2
44# Two directories *.out contain the test results
45
46main()

--- 380 unchanged lines hidden (view full) ---

427
428test_print()
429{
430 echo Testing print and file routines
431 awk 'END {for (i = 1; i < 256; i++) printf("%c", i);print "\n"}' \
432 </dev/null >lines3
433 # GNU and SunOS sed behave differently here
434 mark '7.1'
433 if [ $BSD -eq 1 ] ; then
434 echo 'BSD sed drops core on this one; TEST SKIPPED'
435 else
436 $SED -n l lines3
437 fi
435 $SED -n l lines3
438 mark '7.2' ; $SED -e '/l2_/=' lines1 lines2
439 rm -f lines4
440 mark '7.3' ; $SED -e '3,12w lines4' lines1
441 echo w results
442 cat lines4
443 mark '7.4' ; $SED -e '4r lines2' lines1
444 mark '7.5' ; $SED -e '5r /dev/dds' lines1
445 mark '7.6' ; $SED -e '6r /dev/null' lines1

--- 50 unchanged lines hidden (view full) ---

496 mark '8.14' ;
497 if [ $BSD -eq 1 -o $GNU -eq 1 -o $SUN -eq 1 ] ; then
498 echo BSD/GNU/SUN sed fail this test
499 else
500 $SED -e 'y10\123456789198765432\101' lines1
501 fi
502 mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1
503 mark '8.16'
436 mark '7.2' ; $SED -e '/l2_/=' lines1 lines2
437 rm -f lines4
438 mark '7.3' ; $SED -e '3,12w lines4' lines1
439 echo w results
440 cat lines4
441 mark '7.4' ; $SED -e '4r lines2' lines1
442 mark '7.5' ; $SED -e '5r /dev/dds' lines1
443 mark '7.6' ; $SED -e '6r /dev/null' lines1

--- 50 unchanged lines hidden (view full) ---

494 mark '8.14' ;
495 if [ $BSD -eq 1 -o $GNU -eq 1 -o $SUN -eq 1 ] ; then
496 echo BSD/GNU/SUN sed fail this test
497 else
498 $SED -e 'y10\123456789198765432\101' lines1
499 fi
500 mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1
501 mark '8.16'
504 if [ $BSD -eq 1 ] ; then
505 echo 'BSD sed does not handle branch defined REs'
506 else
507 echo 'eeefff' | $SED -e 'p' -e 's/e/X/p' -e ':x' \
508 -e 's//Y/p' -e '/f/bx'
509 fi
502 echo 'eeefff' | $SED -e '
503 p
504 s/e/X/p
505 :x
506 s//Y/p
507 # Establish limit counter in the hold space
508 # GNU sed version 3.02 enters into an infinite loop here
509 x
510 /.\{10\}/ {
511 s/.*/ERROR/
512 b
513 }
514 s/.*/&./
515 x
516 /f/bx
517 '
510}
511
512test_error()
513{
514 exec 0>&3 4>&1 5>&2
515 exec 0</dev/null
516 exec 2>&1
517 set -x

--- 35 unchanged lines hidden ---
518}
519
520test_error()
521{
522 exec 0>&3 4>&1 5>&2
523 exec 0</dev/null
524 exec 2>&1
525 set -x

--- 35 unchanged lines hidden ---