From 9bf65d0fbaafdbec439ec1144decbf2f5875c1b5 Mon Sep 17 00:00:00 2001 From: Andy Chu Date: Thu, 4 Jul 2019 20:31:30 -0700 Subject: [PATCH] [test/spec] Don't pollute repo, and add old demo. --- .gitignore | 5 ++++- spec/01-char-class.sh | 28 ++++++++++++++++++++++++++++ spec/alias.test.sh | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 spec/01-char-class.sh diff --git a/.gitignore b/.gitignore index b52c1e146f..21935fe3ba 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,12 @@ _build/ _devbuild/ !opy/_regtest/src/_devbuild/ _deps/ +# for mycpp +_gen/ _release/ -libc.so fastlex.so +libc.so line_input.so +posix_.so # Python build support build/temp.* diff --git a/spec/01-char-class.sh b/spec/01-char-class.sh new file mode 100755 index 0000000000..6321f1f4c0 --- /dev/null +++ b/spec/01-char-class.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Usage: +# ./01-char-class.sh + +set -o nounset +set -o pipefail +set -o errexit + +demo() { + [[ a == [a] ]] + [[ a != [^a] ]] + + [[ a == [ab] ]] + [[ a != [^ab] ]] + + [[ a == [[:alpha:]] ]] + [[ a != [^[:alpha:]] ]] + [[ 0 == [^[:alpha:]] ]] + + # NOTE: there is only one negation. You can't mix them. + [[ 0 == [^[:alpha:]] ]] + + echo + echo 'ALL PASSED' +} + +"$@" diff --git a/spec/alias.test.sh b/spec/alias.test.sh index c7ff857b5c..cfcd22bbd9 100644 --- a/spec/alias.test.sh +++ b/spec/alias.test.sh @@ -478,6 +478,7 @@ four ## END #### Alias and command sub (bug regression) +cd $TMP shopt -s expand_aliases echo foo bar > tmp.txt alias a=argv.py