aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/test/script
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-09 11:29:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-09 11:29:23 +0200
commitf1cbb7c9d5c750366fa1918a53d0682f0633b1d9 (patch)
treef5b49b2b1052e693e5f26ec9cfdcee3d3d4e13c3 /unit-tests/test/script
parentfeab490f5f34bf8ecc52d2a439e68b3f2644ab47 (diff)
Various minor semantics changes in testscript language
The .include directive and if-else no longer have to be separated from the following token. This allows to make the decision by looking at just one token. The test scope can no longer have a description inside the scope. It should always be leading the scope itself.
Diffstat (limited to 'unit-tests/test/script')
-rw-r--r--unit-tests/test/script/parser/description.test49
-rw-r--r--unit-tests/test/script/parser/include.test12
2 files changed, 31 insertions, 30 deletions
diff --git a/unit-tests/test/script/parser/description.test b/unit-tests/test/script/parser/description.test
index 48a2faf..1b3f358 100644
--- a/unit-tests/test/script/parser/description.test
+++ b/unit-tests/test/script/parser/description.test
@@ -308,9 +308,11 @@ EOE
# Interaction with test scope merging.
#
-# No merge since both have description.
-#
-$* -s -i <<EOI >>EOO # test-scope-both
+: test-scope-both
+:
+: No merge since both have description.
+:
+$* -s -i <<EOI >>EOO
: foo
{
: bar
@@ -328,26 +330,32 @@ EOI
}
EOO
-$* -s -i <<EOI >>EOO # test-scope-group
-: foo-bar
-: foo bar
+: test-scope-test
+:
+: No merge since test has description.
+:
+$* -s -i <<EOI >>EOO #
{
+ : foo-bar
+ : foo bar
cmd
}
EOI
{
- : id:foo-bar
- : sm:foo bar
- { # foo-bar
- cmd
+ { # 1
+ : id:foo-bar
+ : sm:foo bar
+ { # 1/foo-bar
+ cmd
+ }
}
}
EOO
-$* -s -i <<EOI >>EOO # test-scope-test
+$* -s -i <<EOI >>EOO # test-scope-group
+: foo-bar
+: foo bar
{
- : foo-bar
- : foo bar
cmd
}
EOI
@@ -359,18 +367,3 @@ EOI
}
}
EOO
-
-# Id conflict once moved to outer scope.
-#
-$* <<EOI 2>>EOE != 0 # test-scope-id-dup
-: foo
-cmd
-{
- : foo
- cmd
-}
-cmd
-EOI
-testscript:4:3: error: duplicate id foo
- testscript:1:1: info: previously used here
-EOE
diff --git a/unit-tests/test/script/parser/include.test b/unit-tests/test/script/parser/include.test
index 8210172..65ce7ce 100644
--- a/unit-tests/test/script/parser/include.test
+++ b/unit-tests/test/script/parser/include.test
@@ -1,14 +1,22 @@
: not-directive
:
$* <<EOI >>EOO
-x =
+x = x
".include" foo.test
-.include\$x foo.test
+.include'' foo.test
EOI
.include foo.test
.include foo.test
EOO
+: not-separated
+:
+touch foo.test;
+$* <<EOI
+x = foo.test
+.include\$x
+EOI
+
: none
:
$* <<EOI