--- a/tests/test-run-tests.t Fri Jan 05 19:30:37 2018 +0530
+++ b/tests/test-run-tests.t Fri Jan 05 11:53:33 2018 -0800
@@ -1533,6 +1533,26 @@
python hash seed: * (glob)
[1]
+Test TESTCASE variable
+
+ $ cat > test-cases-ab.t <<'EOF'
+ > $ dostuff() {
+ > > echo "In case $TESTCASE"
+ > > }
+ > #testcases A B
+ > #if A
+ > $ dostuff
+ > In case A
+ > #endif
+ > #if B
+ > $ dostuff
+ > In case B
+ > #endif
+ > EOF
+ $ rt test-cases-ab.t
+ ..
+ # Ran 2 tests, 0 skipped, 0 failed.
+
Test automatic pattern replacement
$ cat << EOF >> common-pattern.py