| | 1 | Warnings: 0 |
| | 2 | Errors: 0 |
| | 3 | Longest string: 124, longest list: 10 |
| | 4 | |
| | 5 | (T3VM) Memory blocks still in use: |
| | 6 | |
| | 7 | Total blocks in use: 0 |
| | 8 | built-in function tests |
| | 9 | str.length() = 26 |
| | 10 | str.substr(5) = [efghijklmnopqrstuvwxyz] |
| | 11 | str.substr(7, 11) = [ghijklmnopq] |
| | 12 | str.substr(7, 30) = [ghijklmnopqrstuvwxyz] |
| | 13 | str.substr(30) = [] |
| | 14 | str.substr(30, 8) = [] |
| | 15 | |
| | 16 | str.startsWith(a) = yes |
| | 17 | str.startsWith(b) = no |
| | 18 | str.startsWith(abc) = yes |
| | 19 | str.startsWith(abcdef) = yes |
| | 20 | str.startsWith(bc) = no |
| | 21 | str.startsWith(abcefg) = no |
| | 22 | |
| | 23 | str.endWith(z) = yes |
| | 24 | str.endWith(y) = no |
| | 25 | str.endsWith(xyz) = yes |
| | 26 | str.endsWith(tuvwxyz) = yes |
| | 27 | str.endsWith(xy) = no |
| | 28 | str.endsWith(tuvxyz) = no |
| | 29 | |
| | 30 | lst.length() = 10 |
| | 31 | lst.sublist(5) = [five, six, seven, eight, nine, ten] |
| | 32 | lst.sublist(5, 3) = [five, six, seven] |
| | 33 | lst.sublist(5, 15) = [five, six, seven, eight, nine, ten] |
| | 34 | lst.sublist(15) = [] |
| | 35 | lst.sublist(15, 3) = [] |
| | 36 | lst.car() = one |
| | 37 | lst.cdr() = [two, three, four, five, six, seven, eight, nine, ten] |
| | 38 | [].car() = nil? yes |
| | 39 | [].cdr() = nil? yes |
| | 40 | lst - 'three' -> [one, two, four, five, six, seven, eight, nine, ten] |
| | 41 | lst - ['four', 'eight'] -> [one, two, three, five, six, seven, nine, ten] |
| | 42 | lst - ['four', '123', 'nine'] -> [one, two, three, five, six, seven, eight, |
| | 43 | ten] |
| | 44 | lst2 == ['one', [2, 3], 'four']: true |
| | 45 | lst2 == ['one', 2, 3, 'four']: nil |
| | 46 | lst2 == ['one', [3, 4], 'four']: nil |
| | 47 | |
| | 48 | dataType() tests |
| | 49 | dataType(nil) = 1 |
| | 50 | dataType(true) = 2 |
| | 51 | dataType(obj1) = 5 |
| | 52 | dataType(&prop1) = 6 |
| | 53 | dataType(123) = 7 |
| | 54 | dataType('hello') = 8 |
| | 55 | dataType('abcdefghijklmnopqrstuvwxyz1234567890' /*dynamic string*/) = 8 |
| | 56 | dataType([1, 2, 3]) = 10 |
| | 57 | dataType([ONE, two, three, four, five, six, seven, eight, nine, ten] /*dynamic |
| | 58 | list*/) = 10 |
| | 59 | dataType(_main) = 12 |
| | 60 | |
| | 61 | varargs tests |
| | 62 | varfunc(1): 1 |
| | 63 | varfunc(1, 2, 3): 1, 2, 3 |
| | 64 | |
| | 65 | upper/lower test |
| | 66 | upper('This is a TEST of UPPER and lower. 123;!@#$') = 'THIS IS A TEST OF UPPER |
| | 67 | AND LOWER. 123;!@#$' |
| | 68 | lower('This is a TEST of UPPER and lower. 123;!@#$') = 'this is a test of upper |
| | 69 | and lower. 123;!@#$' |
| | 70 | |
| | 71 | toString test |
| | 72 | toString(123) = 123 |
| | 73 | toString(123, 8) = 173 |
| | 74 | toString(123, 16) = 7B |
| | 75 | toString(true) = true |
| | 76 | toString(nil) = nil |
| | 77 | toInteger test |
| | 78 | toInteger('nil') = nil |
| | 79 | toInteger('true') = true |
| | 80 | toInteger('123') = 123 |
| | 81 | toInteger('ffff', 16) = 65535 |
| | 82 | toInteger('123', 8) = 83 |
| | 83 | find() test |
| | 84 | 'abcdefghijklmnopqrstuvwxyz1234567890'.find('') = 1 |
| | 85 | 'abcdefghijklmnopqrstuvwxyz1234567890'.find('abcdef') = 1 |
| | 86 | 'abcdefghijklmnopqrstuvwxyz1234567890'.find('xyz') = 24 |
| | 87 | 'abcdefghijklmnopqrstuvwxyz1234567890'.find('1234567890') = 27 |
| | 88 | 'abcdefghijklmnopqrstuvwxyz1234567890'.find('xxx') = |
| | 89 | [ONE, two, three, four, five, six, seven, eight, nine, ten].indexOf('one') = |
| | 90 | [ONE, two, three, four, five, six, seven, eight, nine, ten].indexOf('ONE') = 1 |
| | 91 | [ONE, two, three, four, five, six, seven, eight, nine, ten].indexOf('two') = 2 |
| | 92 | [ONE, two, three, four, five, six, seven, eight, nine, ten].indexOf('ten') = 10 |
| | 93 | [ONE, two, three, four, five, six, seven, eight, nine, ten].indexOf('222') = |
| | 94 | [1, [2, 3], 4].indexOf([2, 3]) = 2 |
| | 95 | [1, [2, 3], 4].indexOf([3, 4]) = |
| | 96 | [1, 2, 3, 4].intersect([3, 4, 5]) = [3, 4] |
| | 97 | lst3.intersect(lst4) = [four, five] |
| | 98 | lst3.intersect(['three', 'six']) = [three] |
| | 99 | ['two', 'four', 'eight'].intersect(lst3) = [two, four] |
| | 100 | lst3.intersect(['six', 'seven', 'eight', 'nine', 'ten']) = [] |
| | 101 | |
| | 102 | Regular Expression Tests |
| | 103 | pat1 = '%<test%>' |
| | 104 | pat2 = '([a-z]+) *%1' |
| | 105 | pat3 = '([a-z]+)([0-9]+)' |
| | 106 | search(pat1, 'this is a test') = [11, 4, test] |
| | 107 | search(pat1, 'testing some tests') = nil |
| | 108 | search(pat1, 'testing a test run') = [11, 4, test] |
| | 109 | search(pat2, 'abc def ghi') = nil |
| | 110 | search(pat2, 'abc def def ghi') = [5, 7, def def] |
| | 111 | group(1) = [5, 3, def] |
| | 112 | match(pat1, 'this is a test') = |
| | 113 | match(pat1, 'test a bit') = 4 |
| | 114 | match(pat1, 'testing one two three') = |
| | 115 | match(pat3, 'abcdef123!!!') = 9 |
| | 116 | group(1) = [1, 6, abcdef] |
| | 117 | group(2) = [7, 3, 123] |
| | 118 | replace(pat1, 'this is a test', 'TEST!!!', ReplaceOnce) = this is a TEST!!! |
| | 119 | replace(pat3, 'this is box123!!!', '%2%1', ReplaceOnce) = this is 123box!!! |
| | 120 | replace(pat2, 'abc def def ghi', '<%*><%*>', ReplaceOnce) = abc <def def><def |
| | 121 | def> ghi |
| | 122 | replace('^[a-z]*$', 'this is a test', '%*%*', ReplaceOnce) = this is a test |
| | 123 | replace('^[a-z]*$', 'testing', '%*%*', ReplaceOnce) = testingtesting |
| | 124 | replace('%([0-9][0-9][0-9]%) *[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]', 'dial |
| | 125 | (800) 555-1212 on phone', '"%*"', ReplaceOnce) = dial "(800) 555-1212" on phone |
| | 126 | replace('[0-9]+', 'abc 123 def 456 789 ghi', '(%*)', ReplaceAll) = abc (123) |
| | 127 | def (456) (789) ghi |
| | 128 | replace('[0-9]+', '123 def 456 789', '(%*)', ReplaceAll) = (123) def (456) |
| | 129 | (789) |
| | 130 | replace('[0-9]+', 'abc 123 def 456 789 ghi', '(%*)', ReplaceOnce) = abc (123) |
| | 131 | def 456 789 ghi |
| | 132 | replace('([a-z])([0-9]+)', 'x1937y2908z4200d', '%1 := %2; ', ReplaceAll) = x := |
| | 133 | 1937; y := 2908; z := 4200; d |
| | 134 | |
| | 135 | (T3VM) Memory blocks still in use: |
| | 136 | |
| | 137 | Total blocks in use: 0 |