From: <mie...@us...> - 2008-01-03 22:46:55
|
Revision: 2054 http://oorexx.svn.sourceforge.net/oorexx/?rev=2054&view=rev Author: miesfeld Date: 2008-01-03 14:47:00 -0800 (Thu, 03 Jan 2008) Log Message: ----------- ooRexxUnit - clean up the label option with intrepret tests in the LabelOption.testGroup so it is more apparent what the test is testing. Modified Paths: -------------- test/branches/test.3.2.0/ooRexx/base/keyword/LabelOption.testGroup Modified: test/branches/test.3.2.0/ooRexx/base/keyword/LabelOption.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/keyword/LabelOption.testGroup 2008-01-03 22:43:24 UTC (rev 2053) +++ test/branches/test.3.2.0/ooRexx/base/keyword/LabelOption.testGroup 2008-01-03 22:47:00 UTC (rev 2054) @@ -170,42 +170,44 @@ self~assertEquals("subtest_04: leaving 'aha1'!", 1, i) - -- test 3 +::method "test_DO_lable_works_with_interpret" str="i=0 ;" - "DO label aha1 ;" - - " self~assertTrue(""subtest_01: LABEL subkeyword on DO known"", .true) ;" - " i=i+1 ;" - - " do label aha2 ;" - - " self~assertTrue(""subtest_02: LABEL subkeyword on DO known"", .true) ;" - + " DO label aha2 ;" - " leave aha2 ;" - - " self~fail(""subtest_03: 'leave aha2' did not work!"") ;" - + " i = 9 ;" - " end ;" - " i=i+1 ;" - "END aha1 ;" - - "self~assertEquals(""subtest_04: leaving 'aha2'!"", 2, i) ;" interpret str + self~assertNotEquals("i must be incremented", 0, i) + self~assertNotEquals("Leave aha2 did not work", 10, i) + self~assertEquals("Do loops with label must leave i == 2", 2, i) -::method "test_DO_LABEL_error 10.2" + +::method "test_DO_LABEL_interpret_with_error" + + -- This test case should produce a synatx error because the label on the END + -- keyword must match the label on the matching DO. Test just that and + -- nothing else. + str="i=0 ;" - "DO label aha1 ;" - - " self~assertTrue(""subtest_01: LABEL subkeyword on DO known"", .true) ;" - " i=i+1 ;" - " do label aha2 ;" - - " self~assertTrue(""subtest_02: LABEL subkeyword on DO known"", .true) ;" - " leave aha2 ;" - - " self~fail(""subtest_03: 'leave aha2' did not work!"") ;" - " end ;" - " i=i+1 ;" - + " leave ;" - "END nixi ;" - - "self~assertEquals(""subtest_04: leaving 'aha2'!"", 2, i) ;" - self~expectSyntax( 10.2 ) + self~expectSyntax(10.2) interpret str - ::method "test_LOOP_LABEL" -- test 1 i=0 @@ -254,39 +256,39 @@ self~assertEquals("subtest_04: leaving 'aha1'!", 1, i) - -- test 4 +::method 'test_LOOP_label_with_interpret' + str="i=0 ;" - "LOOP label aha1 ;" - - " self~assertTrue(""subtest_01: LABEL subkeyword on LOOP known"", .true) ;" - " i=i+1 ;" - " loop label aha2 ;" - - " self~assertTrue(""subtest_02: LABEL subkeyword on LOOP known"", .true) ;" - " leave aha2 ;" - - " self~fail(""subtest_03: 'leave aha2' did not work!"") ;" - + " i = 22 ;" - + " i = 26 ;" - + " i = 27 ;" - " end ;" - " i=i+1 ;" - " leave ;" - "END aha1 ;" - - "self~assertEquals(""subtest_04: leaving 'aha2'!"", 2, i) ;" interpret str + self~assertNotEquals("With LOOP label, i must be incremented", 0, i) + self~assertNotEquals("Leave aha2 did not work", 28, i) + self~assertEquals("LOOP with label must leave i == 2", 2, i) -::method "test_LOOP_LABEL_error 10.2" +::method "test_LOOP_LABEL_interpret_with_error_10.2" + str="i=0 ;" - "LOOP label aha1 ;" - - " self~assertTrue(""subtest_01: LABEL subkeyword on LOOP known"", .true) ;" - " i=i+1 ;" - " do label aha2 ;" - - " self~assertTrue(""subtest_02: LABEL subkeyword on LOOP known"", .true) ;" - " leave aha2 ;" - - " self~fail(""subtest_03: 'leave aha2' did not work!"") ;" - " end ;" - " i=i+1 ;" - " leave ;" - "END nixi ;" - - "self~assertEquals(""subtest_04: leaving 'aha2'!"", 2, i) ;" self~expectSyntax( 10.2 ) interpret str @@ -359,24 +361,22 @@ ::method "test_SELECT_LABEL_error 10.4" - str="i=0 ;" - - "SELECT label aha1 ;" - - " when i=-1 then nop ;" - - " when i=0 then ;" - - " do ;" - - " self~assertTrue(""subtest_01: LABEL subkeyword on SELECT known"", .true) ;" - - " i=i+1 ;" - - " do label aha2 ;" - - " self~assertTrue(""subtest_02: LABEL subkeyword on SELECT known"", .true) ;" - - " leave aha2 ;" - - " self~fail(""subtest_03: 'leave aha2' did not work!"") ;" - - " end ;" - - " i=i+1 ;" - - " leave ;" - - " end ;" - - " otherwise nop ;" - - "END nixi ;" - - "self~assertEquals(""subtest_04: leaving 'aha2'!"", 2, i) ;" + -- This test should produce a syntax error, test just that. + str="i=0 ;" - + "SELECT label aha1 ;" - + " when i=-1 then nop ;" - + " when i=0 then ;" - + " do ;" - + " i=i+1 ;" - + " do label aha2 ;" - + " leave aha2 ;" - + " i = i + 10 ;" - + " end ;" - + " i=i+1 ;" - + " leave ;" - + " end ;" - + " otherwise nop ;" - + "END nixi ;" - self~expectSyntax( 10.4 ) interpret str This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |