"Fossies" - the Fresh Open Source Software Archive

Member "Plone-5.2.5-UnifiedInstaller-1.0/tests/shell-tests.sh" (13 Sep 2021, 944 Bytes) of package /linux/www/Plone-5.2.5-UnifiedInstaller-1.0.tgz:


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.

    1 #!/bin/sh
    2 
    3 # tests for the POSIX compliant shell functions
    4 # we need.
    5 
    6 if which sh > /dev/null 2>&1; then
    7     echo "sh found (expected)"
    8 else
    9     echo sh not found
   10 fi
   11 
   12 if which nonesuch > /dev/null 2>&1
   13 then
   14     echo nonesuch found
   15 else
   16     echo "nonesuch not found (expected)"
   17 fi
   18 
   19 badfun () {
   20     return 1
   21 }
   22 
   23 goodfun () {
   24     return 0
   25 }
   26 
   27 if goodfun; then
   28     echo "Good fun good (expected)"
   29 else
   30     echo "Good fun bad"
   31 fi
   32 
   33 if badfun; then
   34     echo "Bad fun good"
   35 else
   36     echo "Bad fun bad (expected)"
   37 fi
   38 
   39 if [ 1 -eq 1 ]; then
   40     echo "equality good (expected)"
   41 else
   42     echo "equality bad"
   43 fi
   44 
   45 if [ 1 -eq 2 ]; then
   46     echo "inequality good"
   47 else
   48     echo "inequality bad (expected)"
   49 fi
   50 
   51 if [ "1" = "1" ]; then
   52     echo "string equality good (expected)"
   53 else
   54     echo "string equality bad"
   55 fi
   56 
   57 if [ "1" = "2" ]; then
   58     echo "string inequality good"
   59 else
   60     echo "string inequality bad (expected)"
   61 fi
   62 
   63 for option; do
   64     echo $option
   65 done