Home | History | Annotate | Download | only in tests
      1 #!/bin/bash
      2 
      3 [ -f testing.sh ] && . testing.sh
      4 
      5 #testcmd "name "args" "result" "infile" "stdin"
      6 #testing "name" "command" "result" "infile" "stdin"
      7 
      8 export WALRUS=42 BANANA=hello LETTERS=
      9 FILTER="| egrep '^(WALRUS|BANANA|LETTERS)=' | sort"
     10 
     11 testcmd "read" "$FILTER" "BANANA=hello\nLETTERS=\nWALRUS=42\n" "" ""
     12 testcmd "-u" "-u BANANA $FILTER" "LETTERS=\nWALRUS=42\n" "" ""
     13 testcmd "-uu" "-u LETTERS -u WALRUS $FILTER" "BANANA=hello\n" "" ""
     14 testcmd "-i" "-i env" "" "" ""
     15 testcmd "-i =" "-i one=two three=four env | sort" \
     16   "one=two\nthree=four\n" "" ""
     17 testcmd "-0" "-i five=six seven=eight env -0 | sort -z" "five=six\0seven=eight\0" "" ""
     18 unset WALRUS BANANA LETTERS FILTER
     19