1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00
mal/run_argv_test.sh
Joel Martin 4e7d8a1bcf Basic: fix step6 arg test. Gensym. Misc cleanup.
- Strip linefeeds in run_argv_test.sh so that step6 arg test passes
  for basic.
- Add gensym and convert or macro.
- Add gitignore entries for transpiled basic sources.
- Add conj/seq stubs so that step4 self-host loads (if non-step4
  functions are commented out in core.mal)
- Bump up Z% value space by 256 spaces (1K)
- Remove old qb2cbm.sh
2016-10-28 00:09:56 -05:00

40 lines
835 B
Bash
Executable File

#!/bin/bash
#
# Usage: run_argv_test.sh <command line arguments to run mal>
#
# Example: run_argv_test.sh python step6_file.py
#
assert_equal() {
if [ "$1" = "$2" ] ; then
echo "OK: '$1'"
else
echo "FAIL: Expected '$1' but got '$2'"
echo
exit 1
fi
}
if [ -z "$1" ] ; then
echo "Usage: $0 <command line arguments to run mal>"
exit 1
fi
root="$(dirname $0)"
out="$( $@ $root/tests/print_argv.mal aaa bbb ccc | tr -d '\r' )"
assert_equal '("aaa" "bbb" "ccc")' "$out"
# Note: The 'make' implementation cannot handle arguments with spaces in them,
# so for now we skip this test.
#
# out="$( $@ $root/tests/print_argv.mal aaa 'bbb ccc' ddd )"
# assert_equal '("aaa" "bbb ccc" "ddd")' "$out"
out="$( $@ $root/tests/print_argv.mal | tr -d '\r' )"
assert_equal '()' "$out"
echo 'Passed all *ARGV* tests'
echo