From: Will Budic Date: Tue, 18 Mar 2025 18:02:05 +0000 (+1100) Subject: Instructer further implemented. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=eccf7f8e2f3eaf7aebb25eb7530c5668a3b68f2c;p=PerlCNF.git Instructer further implemented. --- diff --git a/tests/testInstructor.pl b/tests/testInstructor.pl index b98bb4f..6e61358 100644 --- a/tests/testInstructor.pl +++ b/tests/testInstructor.pl @@ -26,23 +26,48 @@ try{ $cnf->parse(undef,q( <TEST2>> )); - $test -> nextCase(); + try{ - # New instance doesn't mask it for being global, it is still there! - CNFParser->new(undef,{STRICT=>1})->parse(undef,q( - <TEST>> + # New instance doesn't mask it for being global, is it still there? + CNFParser->new(undef,{STRICT=>1, ENABLE_WARNINGS=>1})->parse(undef,q( + < + #called the following: + TEST + >> )); - print $test->failed("Test failed! Trying to overwrite existing instruction, which are global."); + print $test->failed("Test failed! Passed to overwrite existing instruction, which are global."); }catch{ $test->passed("Passed fail on trying to overwrite existing instruction, which are global."); } - + $test-> nextCase(); + $test->case('Test instructor to generate property.'); + + my $parser = CNFParser->new(undef,{STRICT=>1, ENABLE_WARNINGS=>1})->parse(undef,q( + < + flag:1 + TEST_ME + >> + < + A:1 + B:2 + Some multi line + VALUE is HERE! + >> + + )); + my $mp = $parser -> property('MY_PROP'); + $test->isDefined("\$MY_PROP", $mp); + $test->evaluate("\$MY_PROP->val()","Some multi line\nVALUE is HERE!",$mp->val()); + + $test -> nextCase(); + + ### # List entry with non reserved word instruction. ###