Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test/spec] Don't pollute repo, and add old demo.
- Loading branch information
Andy Chu
committed
Jul 5, 2019
1 parent
06cca17
commit 9bf65d0
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# | ||
# Usage: | ||
# ./01-char-class.sh <function name> | ||
|
||
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' | ||
} | ||
|
||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters