"Fossies" - the Fresh Open Source Software Archive

Member "detox-1.4.5/tests/tests/legacy-utf_8-basic/test.sh" (15 Aug 2021, 1433 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: utf8
    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 LC_ALL=en_US.UTF-8
   16 export LC_ALL
   17 
   18 DETOX=$1
   19 TABLEPATH=$(dirname $TESTBASE)/table
   20 METHOD1=utf_8-basic
   21 METHOD2=safe-basic
   22 METHOD3=wipeup
   23 
   24 # ---------------------------------------------------------------------------
   25 
   26 INPUT="safe string"
   27 OUTPUT="safe_string"
   28 
   29 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   30 
   31 # ---------------------------------------------------------------------------
   32 
   33 INPUT=$(printf "\\u00AE reg")
   34 OUTPUT="reg_reg"
   35 
   36 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   37 
   38 # ---------------------------------------------------------------------------
   39 
   40 INPUT=$(printf "\\u00A9 copy")
   41 OUTPUT="copy_copy"
   42 
   43 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   44 
   45 # ---------------------------------------------------------------------------
   46 
   47 INPUT=$(printf "\\u00C6 capital AE")
   48 OUTPUT="AE_capital_AE"
   49 
   50 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"
   51 
   52 # ---------------------------------------------------------------------------
   53 
   54 INPUT=$(printf "\\u00DE capital thorn")
   55 OUTPUT="TH_capital_thorn"
   56 
   57 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3"