Skip to content

Commit

Permalink
Fixes for #61 also fixes #47, with tests to prove so
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Fairhurst committed Oct 23, 2014
1 parent 3a90ae0 commit bca88b3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/cpp/test/ParseTreeTraverserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3180,4 +3180,37 @@ PTT_TEST_CASE(
PTT_EXPECT(TYPE_ERROR)
);

PTT_TEST_CASE(
TestNestedArrayAndOptionals,
"every MyClass is: \n\
needs Num??; \n\
with Num?[] = [nothing]; \n\
with $Num?[] = []; \n\
with $$Num[]? = []; \n\
with $$$Num[]? = nothing; \n\
with $$$$Num?[][][]?[]?[] = [nothing, [nothing, [[[nothing]]]]];",
PTT_VALID
);

PTT_TEST_CASE(
TestSetOptionalOptionalToValues,
"every MyClass is: \n\
myMethod() { \n\
var Num? = nothing; \n\
Num = [1, 1][0]; \n\
Num = [1, nothing][0]; \n\
Num = [nothing][0]; \n\
var $Num?? = Num; \n\
$Num = nothing; \n\
$Num = 1; \n\
$Num = [1, 1][0]; \n\
$Num = [1, nothing][0]; \n\
$Num = [1, Num][0]; \n\
$Num = [nothing, Num][0]; \n\
$Num = [nothing][0]; \n\
$Num = [Num][0]; \n\
}",
PTT_VALID
);

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit bca88b3

Please sign in to comment.