Skip to content

Commit ed87bcd

Browse files
committed
add tests to the parser spec
1 parent 83a8c24 commit ed87bcd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/test/scala/ParserSpec.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,28 @@ class ParserSpec extends AnyFlatSpec {
258258
assert (p.errors.size == 5)
259259
}
260260
}
261+
"test-multiple-init-blocks.ucl" should "not parse successfully." in {
262+
try {
263+
val fileModules = UclidMain.compile(ConfigCons.createConfig("test/test-multiple-init-blocks.ucl"), lang.Identifier("main"))
264+
// should never get here.
265+
assert (false);
266+
}
267+
catch {
268+
case p : Utils.ParserErrorList =>
269+
assert (p.errors.size == 1)
270+
}
271+
}
272+
"test-multiple-next-blocks.ucl" should "not parse successfully." in {
273+
try {
274+
val fileModules = UclidMain.compile(ConfigCons.createConfig("test/test-multiple-next-blocks.ucl"), lang.Identifier("main"))
275+
// should never get here.
276+
assert (false);
277+
}
278+
catch {
279+
case p : Utils.ParserErrorList =>
280+
assert (p.errors.size == 1)
281+
}
282+
}
261283
"test-typechecker-6.ucl" should "not parse successfully." in {
262284
try {
263285
val fileModules = UclidMain.compile(ConfigCons.createConfig("test/test-typechecker-6.ucl"), lang.Identifier("main"))

0 commit comments

Comments
 (0)