"Fossies" - the Fresh Open Source Software Archive

Member "ansifilter-2.18/src/ci_test.sh" (30 Jan 2021, 850 Bytes) of package /linux/privat/ansifilter-2.18.tar.bz2:


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 and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "ci_test.sh": 2.15_vs_2.16.

    1 #!/bin/bash
    2 
    3 # file needs to be saved as UTF-8!
    4 
    5 echo "Starting sample CI verification script"
    6 
    7 
    8 # test case #1
    9 
   10 OUTPUT=`./src/ansifilter ./src/ci_test_line.col`
   11 RETVAL=$?
   12 
   13 if [ $RETVAL -eq 0 ]; then
   14   echo "Retval test #1 is 0, OK"
   15 else
   16   echo "Retval test #1  is not 0, FAIL"
   17   exit 1
   18 fi
   19 
   20 if [ "$OUTPUT" == "BEGIN Bold Underline Italic Blink Hide Black Red Green Yellow Blue Magenta Cyan White END" ]; then
   21   echo "Output test #1 is correct, OK"
   22 else
   23   echo "Output  test #1 is not right, FAIL"
   24   exit 1
   25 fi
   26 
   27 
   28 # test case #2
   29 
   30 OUTPUT=`echo "123Л123" | ./src/ansifilter --ignore-csi`
   31 
   32 RETVAL=$?
   33 
   34 if [ $RETVAL -eq 0 ]; then
   35   echo "Retval test #2 is 0, OK"
   36 else
   37   echo "Retval test #2 is not 0, FAIL"
   38   exit 1
   39 fi
   40 
   41 if [ "$OUTPUT" == "123Л123" ]; then
   42   echo "Output test #2 is correct, OK"
   43 else
   44   echo "Output  test #2 is not right, FAIL"
   45   exit 1
   46 fi