12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #! /bin/sh
- am_create_testdir=no
- . test-init.sh
- plan_ 12
- set +e
- do_check ()
- {
- $AM_TEST_RUNNER_SHELL -c '
- am_create_testdir=no # Do not pollute the top-level directory.
- . test-init.sh
- echo me=$me
- ' "$1" | grep "^me=$2$"
- command_ok_ "me=$1" test $? -eq 0
- }
- for e in sh tap; do
- do_check foo-bar-.$e 'foo-bar-'
- do_check _foo__bar.$e '_foo__bar'
- do_check 012.$e '012'
- do_check a.b.c.$e 'a\.b\.c'
- done
- do_check foo.bar 'foo\.bar'
- do_check abc. 'abc\.'
- s=$(me=bad $AM_TEST_RUNNER_SHELL -c '
- # Do not pollute the top-level directory.
- am_create_testdir=no
- . test-init.sh
- echo me=$me
- ' foo.sh)
- command_ok_ "override of \$me before test-init.sh causes no error" \
- test $? -eq 0
- r='ok'
- printf '%s\n' "$s" | grep '^me=foo$' || r='not ok'
- printf '%s\n' "$s" | grep 'me=bad' && r='not ok'
- result_ "$r" "\$me from the environment is ignored"
- unset r
- :
|