"Fossies" - the Fresh Open Source Software Archive

Member "detox-1.4.5/tests/tests/legacy-safe-basic/test.sh" (15 Aug 2021, 7310 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: safe
    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-basic
   18 METHOD2=wipeup
   19 
   20 # ---------------------------------------------------------------------------
   21 
   22 INPUT="lower"
   23 OUTPUT="lower"
   24 
   25 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   26 
   27 # ---------------------------------------------------------------------------
   28 
   29 INPUT="^acute"
   30 OUTPUT="^acute"
   31 
   32 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   33 
   34 # ---------------------------------------------------------------------------
   35 
   36 INPUT="&ampersand"
   37 OUTPUT="and_ampersand"
   38 
   39 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   40 
   41 # ---------------------------------------------------------------------------
   42 
   43 INPUT="<angle bracket left"
   44 OUTPUT="angle_bracket_left"
   45 
   46 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   47 
   48 # ---------------------------------------------------------------------------
   49 
   50 INPUT=">angle bracket right"
   51 OUTPUT="angle_bracket_right"
   52 
   53 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   54 
   55 # ---------------------------------------------------------------------------
   56 
   57 INPUT="\\back slash"
   58 OUTPUT="back_slash"
   59 
   60 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   61 
   62 # ---------------------------------------------------------------------------
   63 
   64 INPUT="\`back tick"
   65 OUTPUT="back_tick"
   66 
   67 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   68 
   69 # ---------------------------------------------------------------------------
   70 
   71 INPUT="|bar"
   72 OUTPUT="bar"
   73 
   74 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   75 
   76 # ---------------------------------------------------------------------------
   77 
   78 INPUT="{brace left"
   79 OUTPUT="brace_left"
   80 
   81 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   82 
   83 # ---------------------------------------------------------------------------
   84 
   85 INPUT="}brace right"
   86 OUTPUT="brace_right"
   87 
   88 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   89 
   90 # ---------------------------------------------------------------------------
   91 
   92 INPUT=":colon"
   93 OUTPUT="colon"
   94 
   95 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
   96 
   97 # ---------------------------------------------------------------------------
   98 
   99 INPUT=",comma"
  100 OUTPUT=",comma"
  101 
  102 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  103 
  104 # ---------------------------------------------------------------------------
  105 
  106 INPUT="\@commercial at"
  107 OUTPUT="commercial_at"
  108 
  109 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  110 
  111 # ---------------------------------------------------------------------------
  112 
  113 INPUT="dash-"
  114 OUTPUT="dash-"
  115 
  116 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  117 
  118 # ---------------------------------------------------------------------------
  119 
  120 INPUT="#dash_octothorpe-"
  121 OUTPUT="dash_octothorpe-"
  122 
  123 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  124 
  125 # ---------------------------------------------------------------------------
  126 
  127 INPUT="_dash_underscore-"
  128 OUTPUT="dash_underscore-"
  129 
  130 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  131 
  132 # ---------------------------------------------------------------------------
  133 
  134 INPUT="\$dollar sign"
  135 OUTPUT="dollar_sign"
  136 
  137 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  138 
  139 # ---------------------------------------------------------------------------
  140 
  141 INPUT="\"double quote"
  142 OUTPUT="double_quote"
  143 
  144 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  145 
  146 # ---------------------------------------------------------------------------
  147 
  148 INPUT="ends with octothorpe#"
  149 OUTPUT="ends_with_octothorpe#"
  150 
  151 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  152 
  153 # ---------------------------------------------------------------------------
  154 
  155 INPUT="!exclamation point"
  156 OUTPUT="exclamation_point"
  157 
  158 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  159 
  160 # ---------------------------------------------------------------------------
  161 
  162 INPUT="#octothorpe"
  163 OUTPUT="octothorpe"
  164 
  165 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  166 
  167 # ---------------------------------------------------------------------------
  168 
  169 INPUT="#-octothorpe_dash"
  170 OUTPUT="octothorpe_dash"
  171 
  172 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  173 
  174 # ---------------------------------------------------------------------------
  175 
  176 INPUT="(parenthesis left"
  177 OUTPUT="parenthesis_left"
  178 
  179 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  180 
  181 # ---------------------------------------------------------------------------
  182 
  183 INPUT=")parenthesis right"
  184 OUTPUT="parenthesis_right"
  185 
  186 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  187 
  188 # ---------------------------------------------------------------------------
  189 
  190 INPUT="%percent"
  191 OUTPUT="%percent"
  192 
  193 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  194 
  195 # ---------------------------------------------------------------------------
  196 
  197 INPUT="+plus"
  198 OUTPUT="+plus"
  199 
  200 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  201 
  202 # ---------------------------------------------------------------------------
  203 
  204 INPUT="?question mark"
  205 OUTPUT="question_mark"
  206 
  207 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  208 
  209 # ---------------------------------------------------------------------------
  210 
  211 INPUT=";semi colon"
  212 OUTPUT="semi_colon"
  213 
  214 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  215 
  216 # ---------------------------------------------------------------------------
  217 
  218 INPUT="'single quote"
  219 OUTPUT="single_quote"
  220 
  221 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  222 
  223 # ---------------------------------------------------------------------------
  224 
  225 INPUT=" space"
  226 OUTPUT="space"
  227 
  228 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  229 
  230 # ---------------------------------------------------------------------------
  231 
  232 INPUT="[square bracket left"
  233 OUTPUT="square_bracket_left"
  234 
  235 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  236 
  237 # ---------------------------------------------------------------------------
  238 
  239 INPUT="]square bracket right"
  240 OUTPUT="square_bracket_right"
  241 
  242 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  243 
  244 # ---------------------------------------------------------------------------
  245 
  246 INPUT="_-underscore_dash"
  247 OUTPUT="underscore_dash"
  248 
  249 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  250 
  251 # ---------------------------------------------------------------------------
  252 
  253 INPUT="_underscore"
  254 OUTPUT="underscore"
  255 
  256 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  257 
  258 # ---------------------------------------------------------------------------
  259 
  260 INPUT="~tilde"
  261 OUTPUT="~tilde"
  262 
  263 test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2"
  264