Commit 35cef2e0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add test for export env var

parent bc4e01d4
#!/bin/sh
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$3' do not match with '$2'" || echo "OK for '$1' with '$2'"
}
func()
{
echo "$VAR"
}
VAR=
check VAR-empty "" $(func)
VAR=test
check VAR-fill "test" $(func)
VAR=
check VAR-setbefore "again" $(VAR=again func)
check VAR-emptyafter "" $(func)
# stranges only for function
VAR=try func
check VAR-emptyaftertry "" $(func)
VAR=
VAR=try true
check VAR-emptyaftertry2 "" $(func)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment