From bca88b358809c6c76213c35e36e0122bd363376c Mon Sep 17 00:00:00 2001 From: Mike Fairhurst Date: Thu, 23 Oct 2014 08:50:38 -0700 Subject: [PATCH] Fixes for #61 also fixes #47, with tests to prove so --- src/cpp/test/ParseTreeTraverserTest.cpp | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/cpp/test/ParseTreeTraverserTest.cpp b/src/cpp/test/ParseTreeTraverserTest.cpp index 16efd53..bb46903 100644 --- a/src/cpp/test/ParseTreeTraverserTest.cpp +++ b/src/cpp/test/ParseTreeTraverserTest.cpp @@ -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()