aboutsummaryrefslogtreecommitdiff
path: root/tests/build/parser/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/build/parser/driver.cxx')
-rw-r--r--tests/build/parser/driver.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/build/parser/driver.cxx b/tests/build/parser/driver.cxx
index 4ba589d..0b83cb0 100644
--- a/tests/build/parser/driver.cxx
+++ b/tests/build/parser/driver.cxx
@@ -45,6 +45,23 @@ main ()
assert (!parse ("{foo{:"));
assert (!parse ("foo: bar:"));
assert (!parse ("exe{foo:"));
+
+ // Directory scope.
+ //
+ assert (parse ("test/:\n{\n}"));
+ assert (parse ("test/:\n{\n}\n"));
+ assert (parse ("test/:\n{\nfoo:bar\n}"));
+ assert (parse ("test/:\n{\nfoo:bar\n}"));
+ assert (parse ("test/:\n{\nmore/:\n{\n}\n}"));
+ assert (parse ("test/:\n{\nmore/:\n{\nfoo:{bar baz}\n}\n}"));
+
+ assert (!parse ("test/:\n{"));
+ assert (!parse ("test/:\n{\n"));
+ assert (!parse ("test/:\n{\n:"));
+ assert (!parse ("test/:\n{\n} foo: bar\n"));
+ assert (!parse ("test/ foo:\n{\n}"));
+ assert (!parse ("test foo/:\n{\n}"));
+ assert (!parse ("test/ foo/:\n{\n}"));
}
ostream cnull (nullptr);
@@ -56,6 +73,7 @@ parse (const char* s)
is.exceptions (istream::failbit | istream::badbit);
parser p (cnull);
+ //parser p (cerr);
try
{