Skip to content

Commit 33805dd

Browse files
committed
use chapter for consistency with js-slang
1 parent 127d0c8 commit 33805dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/test.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ JS_SLANG="node node_modules/js-slang/dist/repl/repl.js"
55
SOURCEFILES=src/*/*.js
66
SOURCE_TEST="src/test/framework/main.js"
77

8-
DEFAULT_CHAP=4
8+
DEFAULT_CHAPTER=4
99
DEFAULT_VARIANT="default"
1010

1111
red=`tput setaf 1`
@@ -69,17 +69,17 @@ main() {
6969
# call test_source on each test case in __tests__
7070
for i in "$DIR/__tests__/$(basename ${s} .js)".*
7171
do
72-
# check if first line of test file contains 'chap=' and retrieve its value. Set to the default chapter if it does not
73-
chap=$(awk -F 'chap=' 'FNR==1{ if ($0~"chap=") { print $2 } else { print '$DEFAULT_CHAP' } }' $i | awk -F ' ' '{ print $1 }')
72+
# check if first line of test file contains 'chapter=' and retrieve its value. Set to the default chapter if it does not
73+
chapter=$(awk -F 'chapter=' 'FNR==1{ if ($0~"chapter=") { print $2 } else { print '$DEFAULT_CHAPTER' } }' $i | awk -F ' ' '{ print $1 }')
7474

7575
# check if first line of test file contains 'variant=' and retrieve its value. Set to the default variant if it does not
7676
variant=$(awk -F 'variant=' 'FNR==1{ if ($0~"variant=") { print $2 } else { print '$DEFAULT_VARIANT' } }' $i | awk -F ' ' '{ print $1 }')
7777

7878
# check if first line of test file contains 'source-test'
7979
use_source_test=$(awk 'FNR==1{ if ($0~"source-test") print "yes" }' $i)
8080
if [[ $use_source_test == "yes" ]]
81-
then chap=4 ; test_source_framework $s $i $chap $variant
82-
else test_source $s $i $chap $variant
81+
then chapter=4 ; test_source_framework $s $i $chapter $variant
82+
else test_source $s $i $chapter $variant
8383
fi
8484
done
8585
fi

0 commit comments

Comments
 (0)