# Copyright 2005 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? "abcdeffedcbaabcdeffedcba".lastIndexOf1('c') # value: 21 ? "abcdeffedcbaabcdeffedcba".lastIndexOf1('g') # value: -1 ? "abcdeffedcbaabcdeffedcba".indexOf1('f') # value: 5 ? "the quick brown fox"(4, 9) # value: "quick" ? "the quick brown fox"(10) # value: "brown fox" ? "abcdeffedcbaabcdeffedcba".size() # value: 24 ? "abcdeffed".startsWith("abcdef") # value: true ? "abcdeffed".startsWith("def") # value: false ? "abcdeffed".startsWith("foo") # value: false ? "foo".startsWith("abcdeffed") # value: false ? "foo".startsWith("food") # value: false ? "abcdeffed".endsWith("ffed") # value: true ? "abcdeffed".endsWith("def") # value: false ? "abcdeffed".endsWith("feed") # value: false ? "fed".endsWith("abcdeffed") # value: false ? "ood".endsWith("food") # value: false XXX this should be general EList test, and check coercion, element type, etc ? "abcd112efg12h1ijklm122".lastStartOf("12") # value: 19 ? "abcd112efg12h1ijklm122".lastStartOf("111") # value: -1 ? "abcd112efg12h1ijklm122".startOf("12") # value: 5 ? "abcd112efg12h1ijklm122".startOf("111") # value: -1 ? "".size() # value: 0 ? " ".size() # value: 1 String#replaceAll/2 ? "a".replaceAll("a", "b") # value: "b" ? "a".replaceAll("a", "bb") # value: "bb" ? "abc".replaceAll("b", "c") # value: "acc" ? "babcb".replaceAll("b", "c") # value: "caccc" ? "abcba".replaceAll("b", "!_!") # value: "a!_!c!_!a" ? "a".replaceAll("", "b") # problem: replaceAll: search string may not be empty ? "".replaceAll("a", "b") # value: "" ? "foobarbarbarfoof".replaceAll("bar", "qx") # value: "fooqxqxqxfoof" split ? "".split("<>") # value: [""] ? "abc".split("<>") # value: ["abc"] ? "abc<>def".split("<>") # value: ["abc", "def"] ? "<>abc<>".split("<>") # value: ["", "abc", ""] ? "<>abc<>".split("") # problem: split: separator may not be empty String#add/1 ? "ab" + "bc" # value: "abbc" ? "ab" + 10 # problem: the int 10 doesn't coerce to a ConstList ? "ab" + ["cd"] # value: ['a', 'b', "cd"] ? "ab" + ['c', 'd'] # value: ['a', 'b', 'c', 'd'] rjoin/1 ? ".".rjoin([1, 2, 3, 4]) # problem: the int 1 doesn't coerce to a String ? ".".rjoin(["1", "2", "3", "4", ""]) # value: "1.2.3.4." ? ".".rjoin([]) # value: "" ? ".".rjoin([""]) # value: "" isBare ? "".isBare() # value: true ? "a".isBare() # value: true ? E.toString('a') # value: "a" ? E.toQuote('a') # value: "'a'" ? "abc" :DeepFrozen # value: "abc" String#contains/1 xxx should this merely be false? ? "abc".contains("b") # problem: the String "b" doesn't coerce to a char ? "abc".contains('b') # value: true ? "".contains('b') # value: false ? "abc".contains('d') # value: false Characters ? 'a' :DeepFrozen # value: 'a' next/previous ? 'a'.next() # value: 'b' ? 'b'.previous() # value: 'a' ? pragma.enable("accumulator") > accum ' ' for x in 1..32 { _.previous() } # value: '\u0000' ? pragma.enable("accumulator") > accum ' ' for x in 1..32 { _.previous() }.previous() # problem: there is no character before '\u0000' XXX test last-character.next() comparison ? 'a' < 'b' # value: true ? 'b' < 'a' # value: false ? 'b' < 'b' # value: false ? 'Q' > ' ' # value: true ? ' ' <=> ' ' # value: true ? ' ' <=> '4' # value: false