"Fossies" - the Fresh Open Source Software Archive

Member "detox-1.4.5/tests/tests/legacy-remove_trailing/test.sh" (15 Aug 2021, 1275 Bytes) of package /linux/privat/detox-1.4.5.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 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 "test.sh": 1.4.2_vs_1.4.3.

    1 #!/usr/bin/env bash
    2 #
    3 # Subset of legacy regression tests: remove_trailing
    4 #
    5 
    6 set -e
    7 
    8 if [ -z "$TESTBASE" ] ; then
    9     echo TESTBASE needs to be passed via the env
   10     exit 1
   11 fi
   12 
   13 . $TESTBASE/test-functions
   14 
   15 DETOX=$1
   16 TABLEPATH=$(dirname $TESTBASE)/table
   17 METHOD1=safe
   18 METHOD2=wipeup-remove-trailing
   19 
   20 # ---------------------------------------------------------------------------
   21 
   22 INPUT="___________underscore_______________________.x"
   23 OUTPUT="underscore.x"
   24 
   25 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   26 
   27 # ---------------------------------------------------------------------------
   28 
   29 INPUT="..........how.....does.....this....translate......"
   30 OUTPUT=".how.does.this.translate."
   31 
   32 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   33 
   34 # ---------------------------------------------------------------------------
   35 
   36 INPUT="_-_-_-_-_-dotted-_-_-_-_line.....part......two......."
   37 OUTPUT="dotted-line.part.two."
   38 
   39 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   40 
   41 # ---------------------------------------------------------------------------
   42 
   43 INPUT="blah-.-de_._da"
   44 OUTPUT="blah.de.da"
   45 
   46 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   47