From: <pra...@us...> - 2007-12-31 16:23:19
|
Revision: 1937 http://oorexx.svn.sourceforge.net/oorexx/?rev=1937&view=rev Author: pragmatic_lee Date: 2007-12-31 08:23:19 -0800 (Mon, 31 Dec 2007) Log Message: ----------- add String_wordindexMethod.testGroup and String_wordlengthMethod.testGroup Added Paths: ----------- test/branches/test.3.2.0/ooRexx/base/class/String/String_wordindexMethod.testGroup test/branches/test.3.2.0/ooRexx/base/class/String/String_wordlengthMethod.testGroup Added: test/branches/test.3.2.0/ooRexx/base/class/String/String_wordindexMethod.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/String_wordindexMethod.testGroup (rev 0) +++ test/branches/test.3.2.0/ooRexx/base/class/String/String_wordindexMethod.testGroup 2007-12-31 16:23:19 UTC (rev 1937) @@ -0,0 +1,400 @@ +#!/usr/bin/rexx +/* + name: String_wordindexMethod.testGroup + author: Lee Peedin + date: 2007-12-31 + version: 1.0.0 + +-- line commented lines are ignored, when building the directory of infos from this header + + languageLevel: 6.02 + purpose: Test the wordindex 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(.String_wordindexMethod.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 "String_wordindexMethod.testGroup" subclass TestCase public + +::method 'test000' + .local~vblank = ' ' + .local~zeros1 = copies('0',10000)||'1' + .local~v26 = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z' + .local~v30c = 'asdfQWERzxcvASDFqwerZXCVJRjrJR' + .local~v125 = "'"copies('* ',125)"'" + .local~v250c = copies('*',250) + .local~v8 = 'one two three four five six seven eight' + .local~v10000 = copies('J ',9999)||'K ' + .local~vwbw = 'John'||copies(' ',10000)||'Buckley' + .local~vwbwwbw = 'J'||copies(' ',5000)||copies('*',10000)||copies(' ',5000)||'R' + .local~v19 = '19' + .local~v14 = '14' + +::method 'test001' + self~assertSame('subTest01',''0'',''~wordIndex(1)) + +::method 'test002' + self~expectSyntax(93.905) + xre = 'WORD1 WORD2'~wordIndex(1.000000009) + +::method 'test003' + self~expectSyntax(93.905) + xre = 'WORD1 WORD2'~wordIndex(2.000000009) + +::method 'test004' + self~assertSame('subTest01','1','WORD1 WORD2'~wordIndex(1.000000004)) + +::method 'test005' + self~assertSame('subTest01','7','WORD1 WORD2'~wordIndex(2.000000004)) + +::method 'test006' + self~assertSame('subTest01','1','4a'x~wordIndex(.zeros1)) + +::method 'test007' + self~assertSame('subTest01','0',.vblank~wordIndex(2.55*200-255)) + +::method 'test008' + self~assertSame('subTest01','1','WORD'~wordIndex('31'x)) + +::method 'test009' + self~expectSyntax(93.924) + xre = 'WORD'~wordIndex('30'x) + +::method 'test010' + self~expectSyntax(93.924) + xre = ' '~wordIndex('30'x) + +::method 'test011' + self~assertSame('subTest01','0','4a52'x~wordIndex(2E0)) + +::method 'test012' + self~assertSame('subTest01','0',.v30c~wordIndex('323535'x)) + +::method 'test013' + self~assertSame('subTest01','1','4120422043204420452046204720482049204a204b204c204d204e204f'x~wordIndex(' 1')) + +::method 'test014' + numeric digits 1 + self~assertSame('subTest01','23',.v26~wordIndex('1'||'2')) + +::method 'test015' + numeric digits 1 + self~assertSame('subTest01','23',.v26~wordIndex(' +12 ')) + +::method 'test016' + numeric digits 1 + self~assertSame('subTest01','19',.v26~wordIndex(+12)) + +::method 'test017' + numeric digits 1 + self~assertSame('subTest01','23',.v26~wordIndex(12)) + +::method 'test018' + numeric digits 1 + self~assertSame('subTest01','37',.v26~wordIndex(.v19)) + +::method 'test019' + numeric digits 1 + self~assertSame('subTest01','27',.v26~wordIndex(.v14)) + +::method 'test020' + numeric digits 1 + self~assertSame('subTest01','1',(12+6)~wordIndex(1)) + +::method 'test021' + numeric digits 1 + self~assertSame('subTest01','1','12+6'~wordIndex(1)) + +::method 'test022' + self~assertSame('subTest01','0',.v250c~wordIndex(2)) + +::method 'test023' + self~assertSame('subTest01','0','**********************************************************************************************************************************************************************************************************************************************************'~wordIndex(3)) + +::method 'test024' + self~assertSame('subTest01','25',' asdf qwer zxcv ASDF QWER ZXCV'~wordIndex('.004E3')) + +::method 'test025' + self~assertSame('subTest01','18',.v8~wordIndex(-4+8)) + +::method 'test026' + self~expectSyntax(93.924) + xre = .v8~wordIndex(-4-8) + +::method 'test027' + self~expectSyntax(93.905) + xre = .v8~wordIndex(1.5) + +::method 'test028' + self~assertSame('subTest01','0','6173646620717765722041534446205157455220'x~wordIndex('30303035'x)) + +::method 'test029' + self~assertSame('subTest01','20','61736466207a786376000000000041534446205a584356'x~wordIndex((3*3*3)/9)) + +::method 'test030' + self~assertSame('subTest01','1',nv~wordIndex(1)) + +::method 'test031' + self~assertSame('subTest01','1',nv.~wordIndex(1)) + +::method 'test032' + self~assertSame('subTest01','1',nv.10~wordIndex(1)) + +::method 'test033' + self~expectSyntax(93.905) + xre = .v125~wordIndex(nv) + +::method 'test034' + self~expectSyntax(93.905) + xre = .v125~wordIndex(nv.) + +::method 'test035' + self~expectSyntax(93.905) + xre = .v125~wordIndex(nv.10) + +::method 'test036' + self~expectSyntax(93.905) + xre = novala~wordIndex(novalb) + +::method 'test037' + self~expectSyntax(93.905) + xre = .v125~wordIndex(nv) + +::method 'test038' + self~expectSyntax(93.905) + xre = .v125~wordIndex(nv.) + +::method 'test039' + self~expectSyntax(93.905) + xre = .v125~wordIndex(nv.10) + +::method 'test040' + self~expectSyntax(93.905) + xre = novala~wordIndex(novalb) + +::method 'test041' + self~assertSame('subTest01','19997',.v10000~wordIndex(9999)) + +::method 'test042' + self~assertSame('subTest01','19999',.v10000~wordIndex(10000)) + +::method 'test043' + self~assertSame('subTest01','0',.v10000~wordIndex(10001)) + +::method 'test044' + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX = '1 2 3 4 5 6 7 8 9 0' + self~assertSame('subTest01','13',XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX~wordIndex(7)) + +::method 'test045' + self~assertSame('subTest01','1',.vwbwwbw~wordIndex(1)) + +::method 'test046' + self~assertSame('subTest01','5002',.vwbwwbw~wordIndex(2)) + +::method 'test047' + self~assertSame('subTest01','20002',.vwbwwbw~wordIndex(3)) + +::method 'test048' + self~assertSame('subTest01','1',.vwbw~wordIndex(1)) + +::method 'test049' + self~assertSame('subTest01','10005',.vwbw~wordIndex(2)) + +::method 'test050' + self~assertSame('subTest01','1',(00345)~wordIndex(1)) + +::method 'test051' + self~assertSame('subTest01','1',(3 4 5)~wordIndex(1)) + +::method 'test052' + self~assertSame('subTest01','3',(3 4 5)~wordIndex(2)) + +::method 'test053' + self~assertSame('subTest01','5',(3 4 5)~wordIndex(3)) + +::method 'test054' + self~assertSame('subTest01','1',.v8~wordIndex(1)) + +::method 'test055' + self~assertSame('subTest01','35',.v8~wordIndex(6)) + +::method 'test056' + self~assertSame('subTest01','56',.v8~wordIndex(8)) + +::method 'test057' + v8. = .v8 + self~assertSame('subTest01','1',v8.~wordIndex(1)) + +::method 'test058' + v8. = .v8 + self~assertSame('subTest01','5',v8.~wordIndex(2)) + +::method 'test059' + v8. = .v8 + self~assertSame('subTest01','0',v8.~wordIndex(9)) + +::method 'test060' + v8. = .v8 + self~assertSame('subTest01','18',v8.10~wordIndex(4)) + +::method 'test061' + v8. = .v8 + self~assertSame('subTest01','26',v8.10~wordIndex(5)) + +::method 'test062' + v8. = .v8 + self~assertSame('subTest01','35',v8.10~wordIndex(6)) + +::method 'test063' + self~assertSame('subTest01','1',(.v26||' '||reverse(.v26))~wordIndex(1)) + +::method 'test064' + self~assertSame('subTest01','51',(.v26' 'reverse(.v26))~wordIndex(26)) + +::method 'test065' + self~assertSame('subTest01','53',(.v26 reverse(.v26))~wordIndex(27)) + +::method 'test066' + self~assertSame('subTest01','5',subStr('one two three four',5,9)~wordIndex(2)) + +::method 'test067' + self~assertSame('subTest01','0',.v26~wordIndex(length(translate(.v26,,' ')))) + +::method 'test068' + self~assertSame('subTest01','43',.v26~wordIndex(x2d(16))) + +::method 'test069' + self~assertSame('subTest01','5',(dataType(6) dataType('A'))~wordIndex(2)) + +::method 'test070' + self~assertSame('subTest01','11',errorText(40)~wordIndex(lastPos('O','WORD'))) + +::method 'test071' + self~assertSame('subTest01','5','A B C D E F G'~wordIndex('A B C'~wordIndex(2))) + +::method 'test072' + .local~remove(vblank) + .local~remove(zeros1) + .local~remove(v26) + .local~remove(v30c) + .local~remove(v125) + .local~remove(v250c) + .local~remove(v8) + .local~remove(v10000) + .local~remove(vwbw) + .local~remove(vwbwwbw) + .local~remove(v19) + .local~remove(v14) + +-- from bif.testgroup + -- test the BIF, using examples from the documentation +::method "test_WORDINDEX" + self~assertEquals("subTest1" , 8 , 'Now is the time'~WORDINDEX(3)) + self~assertEquals("subTest2" , 0 , 'Now is the time'~WORDINDEX(6)) + + Added: test/branches/test.3.2.0/ooRexx/base/class/String/String_wordlengthMethod.testGroup =================================================================== --- test/branches/test.3.2.0/ooRexx/base/class/String/String_wordlengthMethod.testGroup (rev 0) +++ test/branches/test.3.2.0/ooRexx/base/class/String/String_wordlengthMethod.testGroup 2007-12-31 16:23:19 UTC (rev 1937) @@ -0,0 +1,396 @@ +#!/usr/bin/rexx +/* + name: String_wordlengthMethod.testGroup + author: Lee Peedin + date: 2007-12-31 + version: 1.0.0 + +-- line commented lines are ignored, when building the directory of infos from this header + + languageLevel: 6.02 + purpose: Test the wordlength 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(.String_wordlengthMethod.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 "String_wordlengthMethod.testGroup" subclass TestCase public + +::method 'test000' + .local~vblank = ' ' + .local~zeros1 = copies('0',10000)||'1' + .local~v26 = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z' + .local~v30c = 'asdfQWERzxcvASDFqwerZXCVJRjrJR' + .local~v125 = "'"copies('* ',125)"'" + .local~v250c = copies('*',250) + .local~v8 = 'one two three four five six seven eight' + .local~v10000 = copies('J ',9999)||'K ' + .local~vwbw = 'John'||copies(' ',10000)||'Buckley' + .local~vwbwwbw = 'J'||copies(' ',5000)||copies('*',10000)||copies(' ',5000)||'R' + .local~v19 = '19' + .local~v14 = '14' + +::method 'test0001' + self~assertSame('subTest01','0',''~wordLength(1)) + +::method 'test0002' + self~expectSyntax(93.905) + xre = 'WORD1 WORD2'~wordLength(1.000000009) + +::method 'test0003' + self~expectSyntax(93.905) + xre = 'WORD1 WORD2'~wordLength(2.000000009) + +::method 'test0004' + self~assertSame('subTest01','5','WORD1 WORD2'~wordLength(1.000000004)) + +::method 'test0005' + self~assertSame('subTest01','5','WORD1 WORD2'~wordLength(2.000000004)) + +::method 'test0006' + self~assertSame('subTest01','1','4a'x~wordLength(.zeros1)) + +::method 'test0007' + self~assertSame('subTest01','0',.vblank~wordLength(2.55*200-255)) + +::method 'test0008' + self~assertSame('subTest01','4','WORD'~wordLength('31'x)) + +::method 'test0009' + self~expectSyntax(93.924) + xre = 'WORD'~wordLength('30'x) + +::method 'test010' + self~expectSyntax(93.924) + xre = ' '~wordLength('30'x) + +::method 'test011' + self~assertSame('subTest01','0','4a52'x~wordLength(2E0)) + +::method 'test012' + self~assertSame('subTest01','0',.v30c~wordLength('323535'x)) + +::method 'test013' + self~assertSame('subTest01','1','4120422043204420452046204720482049204a204b204c204d204e204f'x~wordLength(' 1')) + +::method 'test014' + numeric digits 1 + self~assertSame('subTest01','1',.v26~wordLength('1'||'2')) + +::method 'test015' + numeric digits 1 + self~assertSame('subTest01','1',.v26~wordLength(' +12 ')) + +::method 'test016' + numeric digits 1 + self~assertSame('subTest01','1',.v26~wordLength(+12)) + +::method 'test017' + numeric digits 1 + self~assertSame('subTest01','1',.v26~wordLength(12)) + +::method 'test018' + numeric digits 1 + self~assertSame('subTest01','1',.v26~wordLength(.v19)) + +::method 'test019' + numeric digits 1 + self~assertSame('subTest01','1',.v26~wordLength(.v14)) + +::method 'test020' + numeric digits 1 + self~assertSame('subTest01','4',(12+6)~wordLength(1)) + +::method 'test021' + numeric digits 1 + self~assertSame('subTest01','4','12+6'~wordLength(1)) + +::method 'test022' + self~assertSame('subTest01','0',.v250c~wordLength(2)) + +::method 'test023' + self~assertSame('subTest01','0','**********************************************************************************************************************************************************************************************************************************************************'~wordLength(3)) + +::method 'test024' + self~assertSame('subTest01','4',' asdf qwer zxcv ASDF QWER ZXCV'~wordLength('.004E3')) + +::method 'test025' + self~assertSame('subTest01','4',.v8~wordLength(-4+8)) + +::method 'test026' + self~expectSyntax(93.924) + xre = .v8~wordLength(-4-8) + +::method 'test027' + self~expectSyntax(93.905) + xre = .v8~wordLength(1.5) + +::method 'test028' + self~assertSame('subTest01','0','6173646620717765722041534446205157455220'x~wordLength('30303035'x)) + +::method 'test029' + self~assertSame('subTest01','4','61736466207a786376000000000041534446205a584356'x~wordLength((3*3*3)/9)) + +::method 'test030' + self~assertSame('subTest01','2',nv~wordLength(1)) + +::method 'test031' + self~assertSame('subTest01','3',nv.~wordLength(1)) + +::method 'test032' + self~assertSame('subTest01','5',nv.10~wordLength(1)) + +::method 'test033' + self~expectSyntax(93.905) + xre = .v125~wordLength(nv) + +::method 'test034' + self~expectSyntax(93.905) + xre = .v125~wordLength(nv.) + +::method 'test035' + self~expectSyntax(93.905) + xre = .v125~wordLength(nv.10) + +::method 'test036' + self~expectSyntax(93.905) + xre = novala~wordLength(novalb) + +::method 'test037' + self~assertSame('subTest01',3,nv.~wordLength(1)) + +::method 'test038' + self~expectSyntax(93.905) + xre = .v125~wordLength(nv) + +::method 'test039' + self~expectSyntax(93.905) + xre = .v125~wordLength(nv.10) + +::method 'test040' + self~expectSyntax(93.905) + xre = novala~wordLength(novalb) + +::method 'test041' + self~assertSame('subTest01','1',.v10000~wordLength(9999)) + +::method 'test042' + self~assertSame('subTest01','1',.v10000~wordLength(10000)) + +::method 'test043' + self~assertSame('subTest01','0',.v10000~wordLength(10001)) + +::method 'test044' + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX = '1 2 3 4 5 6 7 8 9 0' + self~assertSame('subTest01','1',XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX~wordLength(7)) + +::method 'test045' + self~assertSame('subTest01','1',.vwbwwbw~wordLength(1)) + +::method 'test046' + self~assertSame('subTest01','10000',.vwbwwbw~wordLength(2)) + +::method 'test047' + self~assertSame('subTest01','1',.vwbwwbw~wordLength(3)) + +::method 'test048' + self~assertSame('subTest01','4',.vwbw~wordLength(1)) + +::method 'test049' + self~assertSame('subTest01','7',.vwbw~wordLength(2)) + +::method 'test050' + self~assertSame('subTest01','5',(00345)~wordLength(1)) + +::method 'test051' + self~assertSame('subTest01','1',(3 4 5)~wordLength(1)) + +::method 'test052' + self~assertSame('subTest01','1',(3 4 5)~wordLength(2)) + +::method 'test053' + self~assertSame('subTest01','1',(3 4 5)~wordLength(3)) + +::method 'test054' + self~assertSame('subTest01','3',.v8~wordLength(1)) + +::method 'test055' + self~assertSame('subTest01','3',.v8~wordLength(6)) + +::method 'test056' + self~assertSame('subTest01','5',.v8~wordLength(8)) + +::method 'test057' + v8. = .v8 + self~assertSame('subTest01','3',v8.~wordLength(1)) + +::method 'test058' + v8. = .v8 + self~assertSame('subTest01','3',v8.~wordLength(2)) + +::method 'test059' + v8. = .v8 + self~assertSame('subTest01','0',v8.~wordLength(9)) + +::method 'test060' + v8. = .v8 + self~assertSame('subTest01','4',v8.10~wordLength(4)) + +::method 'test061' + v8. = .v8 + self~assertSame('subTest01','4',v8.10~wordLength(5)) + +::method 'test062' + v8. = .v8 + self~assertSame('subTest01','3',v8.10~wordLength(6)) + +::method 'test063' + self~assertSame('subTest01','1',(.v26||' '||reverse(.v26))~wordLength(1)) + +::method 'test064' + self~assertSame('subTest01','1',(.v26' 'reverse(.v26))~wordLength(26)) + +::method 'test065' + self~assertSame('subTest01','1',(.v26 reverse(.v26))~wordLength(27)) + +::method 'test066' + self~assertSame('subTest01','5',subStr('one two three four',5,9)~wordLength(2)) + +::method 'test067' + self~assertSame('subTest01','1',.v26~wordLength(x2d(16))) + +::method 'test068' + self~assertSame('subTest01','4',(dataType(6) dataType('A'))~wordLength(2)) + +::method 'test069' + self~assertSame('subTest01','4',errorText(40)~wordLength(lastPos('O','WORD'))) + +::method 'test070' + self~assertSame('subTest01','1','A B C D E F G'~wordLength('A B C'~wordLength(2))) + +::method 'test071' + .local~remove(vblank) + .local~remove(zeros1) + .local~remove(v26) + .local~remove(v30c) + .local~remove(v125) + .local~remove(v250c) + .local~remove(v8) + .local~remove(v10000) + .local~remove(vwbw) + .local~remove(vwbwwbw) + .local~remove(v19) + .local~remove(v14) + +-- from bif.testgroup + -- test the BIF, using examples from the documentation +::method "test_WORDLENGTH" + self~assertEquals("subTest1" , 2 , 'Now is the time'~WORDLENGTH(2) ) + self~assertEquals("subTest2" , 5 , 'Now comes the time'~WORDLENGTH(2)) + self~assertEquals("subTest3" , 0 , 'Now is the time'~WORDLENGTH(6) ) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |