Compact path notation now expands correctly

This commit is contained in:
Simon Brooke 2021-08-18 18:48:05 +01:00
parent 5c6ac7f75d
commit c63c262b74
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
7 changed files with 145 additions and 8 deletions

View file

@ -5,6 +5,7 @@
expected='{}'
actual=`echo "$expected" | target/psse | tail -1`
echo -n "Empty map using compact map notation: "
if [ "${expected}" = "${actual}" ]
then
echo "OK"

31
unit-tests/path-notation.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
#####################################################################
# Create a path from root using compact path notation
expected='(-> oblist :users :simon :functions (quote assoc))'
actual=`echo "'/:users:simon:functions/assoc" | target/psse | tail -1`
echo -n "Path from root (oblist) using compact notation: "
if [ "${expected}" = "${actual}" ]
then
echo "OK"
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi
#####################################################################
# Create a path from the current session using compact path notation
expected='(-> session :input-stream)'
actual=`echo "'$:input-stream" | target/psse | tail -1`
echo -n "Path from current session using compact notation: "
if [ "${expected}" = "${actual}" ]
then
echo "OK"
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi