From: <pra...@us...> - 2007-12-31 20:50:19
|
Revision: 1949 http://oorexx.svn.sourceforge.net/oorexx/?rev=1949&view=rev Author: pragmatic_lee Date: 2007-12-31 12:50:24 -0800 (Mon, 31 Dec 2007) Log Message: ----------- Start migration of tests from String.testGroup to individual testGroups Modified Paths: -------------- test/branches/test.3.2.0/ooRexx/base/class/String/String.testGroup test/branches/test.3.2.0/ooRexx/base/class/String/abs.testGroup test/branches/test.3.2.0/ooRexx/base/class/String/changestr.testGroup Added Paths: ----------- test/branches/test.3.2.0/ooRexx/base/class/String/caselessAbbrev.testGroup test/branches/test.3.2.0/ooRexx/base/class/String/caselessChangestr.testGroup Modified: test/branches/test.3.2.0/ooRexx/base/class/String/String.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/String.testGroup 2007-12-31 20:36:09 UTC (rev 1948) +++ test/branches/test.3.2.0/ooRexx/base/class/String/String.testGroup 2007-12-31 20:50:24 UTC (rev 1949) @@ -261,75 +261,6 @@ self~assertSame("subTest7" , "Open Object Rexx" , 'Open'~' '('Object')~' '('Rexx') ) -- test the BIF, using examples from the documentation -::method "test_ABBREV" - - self~assertTrue( "subTest1", 'Print'~ABBREV("Pri") ) - - self~assertFalse( "subTest2", "PRINT"~ABBREV("Pri") ) - self~assertFalse( "subTest3", "PRINT"~ABBREV("PRI", 4) ) - self~assertFalse( "subTest4", "PRINT"~ABBREV("PRY") ) - self~assertTrue( "subTest5", "PRINT"~ABBREV("") ) - self~assertFalse( "subTest6", "PRINT"~ABBREV("", 1) ) - - -- test the BIF, using examples from the documentation -::method "test_ABBREV_caseless" - - self~assertTrue( "subTest1", 'Print'~caselessABBREV("Pri") ) - - self~assertTrue( "subTest2", "PRINT"~caselessABBREV("Pri") ) - self~assertFalse( "subTest3", "PRINT"~caselessABBREV("PRI", 4) ) - self~assertFalse( "subTest4", "PRINT"~caselessABBREV("PRY") ) - self~assertTrue( "subTest5", "PRINT"~caselessABBREV("") ) - self~assertFalse( "subTest6", "PRINT"~caselessABBREV("", 1) ) - - - -- test the BIF, using examples from the documentation -::method "test_ABS" - - self~assertEquals("subTest1" , 12.3 , 12.3~ABS ) - self~assertEquals("subTest1b", 12.3 ,'12.3'~ABS ) - self~assertEquals("subTest2" , 0.307 , ' -0.307'~ABS ) - - -- new tests - self~assertEquals("subTest03", 0 , ' -0'~ABS ) - self~assertEquals("subTest04", 0 , ' +0'~ABS ) - self~assertEquals("subTest05", 0 , ' - 0 '~ABS ) - self~assertEquals("subTest06", 0 , ' + 0 '~ABS ) - self~assertEquals("subTest07", 1 , ' -1'~ABS ) - self~assertEquals("subTest08", 1 , ' +1'~ABS ) - self~assertEquals("subTest09", 1 , ' - 1 '~ABS ) - self~assertEquals("subTest10", 1 , ' + 1 '~ABS ) - - -- test the BIF, using examples from the documentation -::method "test_B2X" - - self~assertSame("subTest1" , 'C3' , '11000011'~B2X ) - self~assertSame("subTest2" , '17' , '10111'~B2X ) - self~assertSame("subTest3" , '5' , '101'~B2X ) - self~assertSame("subTest4" , '1F0' , '1 1111 0000'~B2X ) - self~assertSame("subTest5" , '23' , '10111'~B2X~X2D ) /* decimal 23 */ - - - -- test the BIF, using examples from the documentation -::method "test_BITAND" - - self~assertSame("subTest1" , '12'x , '12'x~BITAND ) - self~assertSame("subTest2" , '23'x , '73'x~BITAND('27'x) ) - self~assertSame("subTest3" , '1155'x , '13'x~BITAND('5555'x) ) - self~assertSame("subTest4" , '1154'x , '13'x~BITAND('5555'x,'74'x) ) - self~assertSame("subTest5" , 'PQRS' , 'pQrS'~BITAND(,'DF'x) ) /* ASCII */ - - -- test the BIF, using examples from the documentation -::method "test_BITOR" - - self~assertSame("subTest1" , '12'x , '12'x~BITOR ) - self~assertSame("subTest2" , '35'x , '15'x~BITOR('24'x) ) - self~assertSame("subTest3" , '3556'x , '15'x~BITOR('2456'x) ) - self~assertSame("subTest4" , '35F6'x , '15'x~BITOR('2456'x,'F0'x) ) - self~assertSame("subTest5" , '5D5D'x , '1111'x~BITOR(,'4D'x) ) - self~assertSame("subTest6" , 'pqrs' , 'pQrS'~BITOR(,'20'x) ) /* ASCII */ - - -- test the BIF, using examples from the documentation ::method "test_BITXOR" self~assertSame("subTest1" , '12'x , '12'x~BITXOR ) @@ -341,95 +272,7 @@ self~assertSame("subTest7" , 'E53302'x , 'C711'x~BITXOR('222222'x,' ') ) /* ASCII */ -- test the BIF, using examples from the documentation -::method "test_C2D" - - self~assertEquals("subTest1" , 9 , '09'X~C2D ) - self~assertEquals("subTest2" , 129 , '81'X~C2D ) - self~assertEquals("subTest3" , 65409 , 'FF81'X~C2D ) - self~assertEquals("subTest4" , 0 , ""~C2D ) - self~assertEquals("subTest5" , 97 , 'a'~C2D ) /* ASCII */ - - self~assertEquals("subTest6" , -127 , '81'X~C2D(1) ) -- -- -- - self~assertEquals("subTest7" , 129 , '81'X~C2D(2) ) - self~assertEquals("subTest8" , -127 , 'FF81'X~C2D(2) ) - self~assertEquals("subTest9" , -127 , 'FF81'X~C2D(1) ) - self~assertEquals("subTest10", 127 , 'FF7F'X~C2D(1) ) - self~assertEquals("subTest11", -3967 , 'F081'X~C2D(2) ) - self~assertEquals("subTest12", -127 , 'F081'X~C2D(1) ) - self~assertEquals("subTest13", 0 , '0031'X~C2D(0) ) - - - -- test the BIF, using examples from the documentation -::method "test_C2X" - - self~assertEquals("subTest1" , '0123' , '0123'X~C2X ) /* '30313233'X in ASCII */ - self~assertEquals("subTest2" , '5A4438', 'ZD8'~C2X ) /* '354134343338'X in ASCII */ - - - - -- test the BIF, using examples from the documentation -::method "test_CENTER" - - self~assertSame("subTest1" , ' ABC ' , abc~CENTER(7) ) - self~assertSame("subTest2" , '--ABC---' , abc~CENTER(8,'-') ) - self~assertSame("subTest3" , 'e blue s' , 'The blue sky'~CENTRE(8) ) - self~assertSame("subTest4" , 'e blue ' , 'The blue sky'~CENTRE(7) ) - - - -- test the BIF, using examples from the documentation -::method "test_CHANGESTR" - - self~assertSame("subTest1" , '000' , 101100~CHANGESTR('1',"") ) - self~assertSame("subTest2" , 'X0XX00' , 101100~CHANGESTR('1','X') ) - - -- new tests - self~assertSame("subTest3", '101100' , '101100'~changestr('','X') ) - self~assertSame("subTest4", '' , ''~changestr('1','X') ) - - -- new tests: optional, trailing "count" argument - self~assertSame("subTest5", 'ha-lo' , 'hallo'~changeStr('l','-',1) ) - self~assertSame("subTest6", 'ha--o' , 'hallo'~changeStr('l','-',2) ) - self~assertSame("subTest7", 'ha--o' , 'hallo'~changestr('l','-',3) ) - -::method "test_changeStr_error_93.907" - self~expectSyntax(93.907) - 'aha'~changeStr('a','A',0) - - - -::method "test_ChangeStr_caseless" - - self~assertSame("subTest1" , 'aABBcC' , "aAbBcC"~caselessChangeStr('b',"B") ) - self~assertSame("subTest2" , 'aAbbcC' , "aAbBcC"~caselessChangeStr('B',"b") ) - self~assertSame("subTest3" , 'aA99cC' , "aAbBcC"~caselessChangeStr('B',"9") ) - - -- new tests: optional, trailing "count" argument - self~assertSame("subTest4a", 'ha-lo' , 'hallo'~caselessChangeStr('L','-',1) ) - self~assertSame("subTest4b", 'ha-lo' , 'haLlo'~caselessChangeStr('L','-',1) ) - self~assertSame("subTest4c", 'ha-Lo' , 'haLLo'~caselessChangeStr('L','-',1) ) - self~assertSame("subTest4d", 'ha-lo' , 'haLlo'~caselessChangeStr('l','-',1) ) - self~assertSame("subTest4e", 'ha-Lo' , 'haLLo'~caselessChangeStr('l','-',1) ) - - self~assertSame("subTest5a", 'ha--o' , 'hallo'~caselessChangeStr('l','-',2) ) - self~assertSame("subTest5b", 'ha--o' , 'haLlo'~caselessChangeStr('L','-',2) ) - self~assertSame("subTest5c", 'ha--o' , 'haLLo'~caselessChangeStr('L','-',2) ) - self~assertSame("subTest5d", 'ha--o' , 'haLlo'~caselessChangeStr('l','-',2) ) - self~assertSame("subTest5e", 'ha--o' , 'haLLo'~caselessChangeStr('l','-',2) ) - - self~assertSame("subTest6a", 'ha--o' , 'hallo'~caselessChangestr('l','-',3) ) - self~assertSame("subTest6b", 'ha--o' , 'haLlo'~caselessChangeStr('L','-',3) ) - self~assertSame("subTest6c", 'ha--o' , 'haLLo'~caselessChangeStr('L','-',3) ) - self~assertSame("subTest6d", 'ha--o' , 'haLlo'~caselessChangeStr('l','-',3) ) - self~assertSame("subTest6e", 'ha--o' , 'haLLo'~caselessChangeStr('l','-',3) ) - -::method "test_changeStr_caseless_error_93.907" - self~expectSyntax(93.907) - 'aha'~caselessChangeStr('a','A',0) - - - - -- test the BIF, using examples from the documentation ::method "test_COMPARE" self~assertEquals("subTest1" , 0 , 'abc' ~COMPARE('abc') ) Modified: test/branches/test.3.2.0/ooRexx/base/class/String/abs.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/abs.testGroup 2007-12-31 20:36:09 UTC (rev 1948) +++ test/branches/test.3.2.0/ooRexx/base/class/String/abs.testGroup 2007-12-31 20:50:24 UTC (rev 1949) @@ -308,4 +308,14 @@ ::method "test_102" self~assertSame("subTest102", 0.307, ' -0.307'~abs) + -- new tests + self~assertEquals("subTest03", 0 , ' -0'~ABS ) + self~assertEquals("subTest04", 0 , ' +0'~ABS ) + self~assertEquals("subTest05", 0 , ' - 0 '~ABS ) + self~assertEquals("subTest06", 0 , ' + 0 '~ABS ) + self~assertEquals("subTest07", 1 , ' -1'~ABS ) + self~assertEquals("subTest08", 1 , ' +1'~ABS ) + self~assertEquals("subTest09", 1 , ' - 1 '~ABS ) + self~assertEquals("subTest10", 1 , ' + 1 '~ABS ) + Added: test/branches/test.3.2.0/ooRexx/base/class/String/caselessAbbrev.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/caselessAbbrev.testGroup (rev 0) +++ test/branches/test.3.2.0/ooRexx/base/class/String/caselessAbbrev.testGroup 2007-12-31 20:50:24 UTC (rev 1949) @@ -0,0 +1,136 @@ +#!/usr/bin/rexx +/* + name: caselessAbbrev.testGroup + author: Lee Peedin + date: 2007-12-20 + version: 1.0.0 + +-- line commented lines are ignored, when building the directory of infos from this header + + languageLevel: 6.02 + purpose: Test the caselessAbbrev method of the class String. + remark: Initial test unit for demonstration purposes, needs to be completed. + + license: CPL 1.0 (Common Public License v1.0, see below) + link: + +// category needs not to be numbered, importance is given by position (1=most important) + category: ooRexx + category: Base + category: Class + category: String +*/ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007 - 2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*----------------------------------------------------------------------------*/ + + +------------------------------------------------------------------------------------------- +-- ===> adapt the "testGroupList" to your testCase classes; each element in the list is <=== +-- ===> an array object, the first element containing the testCase class object, the <=== +-- ===> second element is a list of test method names which are regarded to be <=== +-- ===> mandatory (if the list remains empty all test methods are mandatory) <=== + + /* list of array objects, each containing the testGroup class object and an + optional list of mandatory test case methods name */ +mandatoryTestMethods=.list~new -- no mandatory tests for this testCase class +testGroupList=.list~of( .array~of(.caselessAbbrev.testGroup, mandatoryTestMethods) ) + + +------------------------------------------------------------------------------------------- +-- ===> the following code needs not to be individualized <=== + + -- read top comment, containing infos about this program +arrLines=.array~new +do i=1 to 150 until arrLines[i]="*/" + arrLines[i]=sourceline(i) +end + -- supply information for the testClass(es) in this file; the class attribute + -- "TestCaseInfo" (a directory object, index points to a queue) will store + -- the parsed infos +aTestGroupClass=testGroupList~at(testGroupList~first)[1] -- get first testClass + + -- will parse the array lines and store result in class object +call makeDirTestInfo aTestGroupClass, arrLines +tmpDir=aTestGroupClass~TestCaseInfo +parse source s -- op_sys invocationType fullPathToThisFile +tmpDir~setentry("test_Case-source", s) + + -- now add this directory to other testCase classes, if any left +do arr over testGroupList + if arr[1]=aTestGroupClass then iterate -- already handled + arr[1]~TestCaseInfo=tmpDir -- save info in class object +end + +-- if this file is CALLed or REQUIRED then define an entry "bRunTestLocally" in .local +-- and set it to .false; this way the independent local invocation of the tests is inhibited +if .local~hasentry("bRunTestsLocally")=.false then + .local~bRunTestsLocally=.true -- if this file is executed directly, then run tests for debugging + +if .bRunTestsLocally=.true then -- run ALL tests in this test unit +do + ts=.testSuite~new -- create a testSuite + do arr over testGroupList + -- create a testSuite for the given test case class, use all its testmethods + ts~addTest( .testSuite~new(arr[1])) + end + -- testResult=.testSuite~new(testGroupClass)~run + testResult=ts~run -- now run all the tests + + call simpleFormatTestResults testResult +end + + /* return list of array objects containing test case classes and + optionally list of mandatory test methods */ +return testGroupList + +::requires ooRexxUnit.cls -- load the ooRexxUnit classes + +::class "caselessAbbrev.testGroup" subclass TestCase public + + -- test the BIF, using examples from the documentation +::method "test_ABBREV_caseless" + + self~assertTrue( "subTest1", 'Print'~caselessABBREV("Pri") ) + + self~assertTrue( "subTest2", "PRINT"~caselessABBREV("Pri") ) + self~assertFalse( "subTest3", "PRINT"~caselessABBREV("PRI", 4) ) + self~assertFalse( "subTest4", "PRINT"~caselessABBREV("PRY") ) + self~assertTrue( "subTest5", "PRINT"~caselessABBREV("") ) + self~assertFalse( "subTest6", "PRINT"~caselessABBREV("", 1) ) + + + Added: test/branches/test.3.2.0/ooRexx/base/class/String/caselessChangestr.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/caselessChangestr.testGroup (rev 0) +++ test/branches/test.3.2.0/ooRexx/base/class/String/caselessChangestr.testGroup 2007-12-31 20:50:24 UTC (rev 1949) @@ -0,0 +1,155 @@ +#!/usr/bin/rexx +/* + name: caselessChangestr.testGroup + author: Lee Peedin + date: 2007-12-20 + version: 1.0.0 + +-- line commented lines are ignored, when building the directory of infos from this header + + languageLevel: 6.02 + purpose: Test the caselessChangestr method of the class String. + remark: Initial test unit for demonstration purposes, needs to be completed. + + license: CPL 1.0 (Common Public License v1.0, see below) + link: + +// category needs not to be numbered, importance is given by position (1=most important) + category: ooRexx + category: Base + category: Class + category: String +*/ +/*----------------------------------------------------------------------------*/ +/* */ +/* Copyright (c) 2007 - 2008 Rexx Language Association. All rights reserved. */ +/* */ +/* This program and the accompanying materials are made available under */ +/* the terms of the Common Public License v1.0 which accompanies this */ +/* distribution. A copy is also available at the following address: */ +/* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */ +/* */ +/* Redistribution and use in source and binary forms, with or */ +/* without modification, are permitted provided that the following */ +/* conditions are met: */ +/* */ +/* Redistributions of source code must retain the above copyright */ +/* notice, this list of conditions and the following disclaimer. */ +/* Redistributions in binary form must reproduce the above copyright */ +/* notice, this list of conditions and the following disclaimer in */ +/* the documentation and/or other materials provided with the distribution. */ +/* */ +/* Neither the name of Rexx Language Association nor the names */ +/* of its contributors may be used to endorse or promote products */ +/* derived from this software without specific prior written permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ +/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ +/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ +/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ +/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ +/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ +/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ +/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */ +/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ +/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */ +/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* */ +/*----------------------------------------------------------------------------*/ + + +------------------------------------------------------------------------------------------- +-- ===> adapt the "testGroupList" to your testCase classes; each element in the list is <=== +-- ===> an array object, the first element containing the testCase class object, the <=== +-- ===> second element is a list of test method names which are regarded to be <=== +-- ===> mandatory (if the list remains empty all test methods are mandatory) <=== + + /* list of array objects, each containing the testGroup class object and an + optional list of mandatory test case methods name */ +mandatoryTestMethods=.list~new -- no mandatory tests for this testCase class +testGroupList=.list~of( .array~of(.caselessChangestr.testGroup, mandatoryTestMethods) ) + + +------------------------------------------------------------------------------------------- +-- ===> the following code needs not to be individualized <=== + + -- read top comment, containing infos about this program +arrLines=.array~new +do i=1 to 150 until arrLines[i]="*/" + arrLines[i]=sourceline(i) +end + -- supply information for the testClass(es) in this file; the class attribute + -- "TestCaseInfo" (a directory object, index points to a queue) will store + -- the parsed infos +aTestGroupClass=testGroupList~at(testGroupList~first)[1] -- get first testClass + + -- will parse the array lines and store result in class object +call makeDirTestInfo aTestGroupClass, arrLines +tmpDir=aTestGroupClass~TestCaseInfo +parse source s -- op_sys invocationType fullPathToThisFile +tmpDir~setentry("test_Case-source", s) + + -- now add this directory to other testCase classes, if any left +do arr over testGroupList + if arr[1]=aTestGroupClass then iterate -- already handled + arr[1]~TestCaseInfo=tmpDir -- save info in class object +end + +-- if this file is CALLed or REQUIRED then define an entry "bRunTestLocally" in .local +-- and set it to .false; this way the independent local invocation of the tests is inhibited +if .local~hasentry("bRunTestsLocally")=.false then + .local~bRunTestsLocally=.true -- if this file is executed directly, then run tests for debugging + +if .bRunTestsLocally=.true then -- run ALL tests in this test unit +do + ts=.testSuite~new -- create a testSuite + do arr over testGroupList + -- create a testSuite for the given test case class, use all its testmethods + ts~addTest( .testSuite~new(arr[1])) + end + -- testResult=.testSuite~new(testGroupClass)~run + testResult=ts~run -- now run all the tests + + call simpleFormatTestResults testResult +end + + /* return list of array objects containing test case classes and + optionally list of mandatory test methods */ +return testGroupList + +::requires ooRexxUnit.cls -- load the ooRexxUnit classes + +::class "caselessChangestr.testGroup" subclass TestCase public + +::method "test_ChangeStr_caseless" + + self~assertSame("subTest1" , 'aABBcC' , "aAbBcC"~caselessChangeStr('b',"B") ) + self~assertSame("subTest2" , 'aAbbcC' , "aAbBcC"~caselessChangeStr('B',"b") ) + self~assertSame("subTest3" , 'aA99cC' , "aAbBcC"~caselessChangeStr('B',"9") ) + + -- new tests: optional, trailing "count" argument + self~assertSame("subTest4a", 'ha-lo' , 'hallo'~caselessChangeStr('L','-',1) ) + self~assertSame("subTest4b", 'ha-lo' , 'haLlo'~caselessChangeStr('L','-',1) ) + self~assertSame("subTest4c", 'ha-Lo' , 'haLLo'~caselessChangeStr('L','-',1) ) + self~assertSame("subTest4d", 'ha-lo' , 'haLlo'~caselessChangeStr('l','-',1) ) + self~assertSame("subTest4e", 'ha-Lo' , 'haLLo'~caselessChangeStr('l','-',1) ) + + self~assertSame("subTest5a", 'ha--o' , 'hallo'~caselessChangeStr('l','-',2) ) + self~assertSame("subTest5b", 'ha--o' , 'haLlo'~caselessChangeStr('L','-',2) ) + self~assertSame("subTest5c", 'ha--o' , 'haLLo'~caselessChangeStr('L','-',2) ) + self~assertSame("subTest5d", 'ha--o' , 'haLlo'~caselessChangeStr('l','-',2) ) + self~assertSame("subTest5e", 'ha--o' , 'haLLo'~caselessChangeStr('l','-',2) ) + + self~assertSame("subTest6a", 'ha--o' , 'hallo'~caselessChangestr('l','-',3) ) + self~assertSame("subTest6b", 'ha--o' , 'haLlo'~caselessChangeStr('L','-',3) ) + self~assertSame("subTest6c", 'ha--o' , 'haLLo'~caselessChangeStr('L','-',3) ) + self~assertSame("subTest6d", 'ha--o' , 'haLlo'~caselessChangeStr('l','-',3) ) + self~assertSame("subTest6e", 'ha--o' , 'haLLo'~caselessChangeStr('l','-',3) ) + +::method "test_changeStr_caseless_error_93.907" + self~expectSyntax(93.907) + 'aha'~caselessChangeStr('a','A',0) + + + + Modified: test/branches/test.3.2.0/ooRexx/base/class/String/changestr.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/changestr.testGroup 2007-12-31 20:36:09 UTC (rev 1948) +++ test/branches/test.3.2.0/ooRexx/base/class/String/changestr.testGroup 2007-12-31 20:50:24 UTC (rev 1949) @@ -148,3 +148,20 @@ ::method "test_102" self~assertSame("subTest102", 'X0XX00' , '101100'~CHANGESTR('1','X') ) +::method "test_CHANGESTR" + -- new tests + self~assertSame("subTest3", '101100' , '101100'~changestr('','X') ) + self~assertSame("subTest4", '' , ''~changestr('1','X') ) + + -- new tests: optional, trailing "count" argument + self~assertSame("subTest5", 'ha-lo' , 'hallo'~changeStr('l','-',1) ) + self~assertSame("subTest6", 'ha--o' , 'hallo'~changeStr('l','-',2) ) + self~assertSame("subTest7", 'ha--o' , 'hallo'~changestr('l','-',3) ) + +::method "test_changeStr_error_93.907" + self~expectSyntax(93.907) + 'aha'~changeStr('a','A',0) + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |