"Fossies" - the Fresh Open Source Software Archive

Member "CSSC-1.4.1/tests/binary/diff.sh" (11 May 2010, 776 Bytes) of package /linux/privat/CSSC-1.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/sh
    2 # diff.sh:  Testing for the system diff utility.
    3 
    4 # Import common functions & definitions.
    5 . ../common/test-common
    6 . ../common/real-thing
    7 . ../common/config-data
    8 
    9 if $binary_support
   10 then
   11     true
   12 else
   13     echo "Skipping these tests -- no binary file support."
   14     exit 0
   15 fi 
   16 
   17 
   18 echo_nonl t1...
   19 remove test/d1 test/d2 test
   20 mkdir test
   21 echo hello > test/d1
   22 echo hello > test/d2
   23 ${DIFF} test/d1 test/d2 >got.stdout 2>got.stderr 
   24 rv=$?
   25 if test $rv -ne 0
   26 then
   27     fail "${DIFF} returns nozero for identical files"
   28 fi
   29 echo passed
   30 
   31 
   32 
   33 
   34 echo_nonl t2...
   35 remove test/d2 
   36 echo world > test/d2
   37 ${DIFF} test/d1 test/d2 >got.stdout 2>got.stderr 
   38 rv=$?
   39 if test $rv -eq 0
   40 then
   41     fail "${DIFF} returns zero for nonidentical files"
   42 fi
   43 remove test/d1 test/d2 test
   44 echo passed
   45 
   46 success