OLD | NEW |
1 <meta charset="utf-8"> | 1 <meta charset="utf-8"> |
2 <div id="container"></div> | 2 <div id="container"></div> |
3 <pre id="console" style="visibility: hidden;"></pre> | 3 <pre id="console" style="visibility: hidden;"></pre> |
4 <script> | 4 <script> |
5 function log(message) | 5 function log(message) |
6 { | 6 { |
7 document.getElementById("console").appendChild(document.createTextNode(m
essage + "\n")); | 7 document.getElementById("console").appendChild(document.createTextNode(m
essage + "\n")); |
8 } | 8 } |
9 | 9 |
10 function testFindString(text, target, options, expectedRanges) | 10 function testFindString(text, target, options, expectedRanges) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 testFindString("Lorem ipsum dolor sit amet", "o", ["Backwards", "WrapAround"
], [[15, 16], [13, 14], [1, 2], [15, 16]]); | 43 testFindString("Lorem ipsum dolor sit amet", "o", ["Backwards", "WrapAround"
], [[15, 16], [13, 14], [1, 2], [15, 16]]); |
44 testFindString("Lorem ipsum dolor sit amet", "O", [], [[]]); | 44 testFindString("Lorem ipsum dolor sit amet", "O", [], [[]]); |
45 testFindString("Lorem ipsum dolor sit amet", "O", ["CaseInsensitive"], [[1,
2], [13, 14], [15, 16]]); | 45 testFindString("Lorem ipsum dolor sit amet", "O", ["CaseInsensitive"], [[1,
2], [13, 14], [15, 16]]); |
46 | 46 |
47 testFindString("insurmountable mountain", "mount", [], [[5, 10], [15, 20], [
]]); | 47 testFindString("insurmountable mountain", "mount", [], [[5, 10], [15, 20], [
]]); |
48 testFindString("insurmountable mountain", "mount", ["AtWordStarts"], [[15, 2
0], []]); | 48 testFindString("insurmountable mountain", "mount", ["AtWordStarts"], [[15, 2
0], []]); |
49 | 49 |
50 testFindString("cocoa", "co", [], [[0, 2], [2, 4], []]); | 50 testFindString("cocoa", "co", [], [[0, 2], [2, 4], []]); |
51 testFindString("cocoa", "co", ["AtWordStarts"], [[0, 2], []]); | 51 testFindString("cocoa", "co", ["AtWordStarts"], [[0, 2], []]); |
52 | 52 |
53 testFindString("webkit.org", "org", ["AtWordStarts"], [[]]); | 53 testFindString("webkit.org", "org", ["AtWordStarts"], [[7, 10]]); |
54 testFindString("webkit.org", ".org", ["AtWordStarts"], [[6, 10], []]); | 54 testFindString("webkit.org", ".org", ["AtWordStarts"], [[6, 10], []]); |
55 | 55 |
56 testFindString("webkit.org", "rg", ["AtWordStarts", "TreatMedialCapitalAsWor
dStart"], [[]]); | 56 testFindString("webkit.org", "rg", ["AtWordStarts", "TreatMedialCapitalAsWor
dStart"], [[]]); |
57 testFindString("webkit.org", "org", ["AtWordStarts", "TreatMedialCapitalAsWo
rdStart"], [[7, 10], []]); | 57 testFindString("webkit.org", "org", ["AtWordStarts", "TreatMedialCapitalAsWo
rdStart"], [[7, 10], []]); |
58 testFindString("webkit.org", ".org", ["AtWordStarts", "TreatMedialCapitalAsW
ordStart"], [[6, 10], []]); | 58 testFindString("webkit.org", ".org", ["AtWordStarts", "TreatMedialCapitalAsW
ordStart"], [[6, 10], []]); |
59 testFindString("webkit.org", "t.org", ["AtWordStarts", "TreatMedialCapitalAs
WordStart"], [[]]); | 59 testFindString("webkit.org", "t.org", ["AtWordStarts", "TreatMedialCapitalAs
WordStart"], [[]]); |
60 | 60 |
61 testFindString("WebKit", "it", ["AtWordStarts", "TreatMedialCapitalAsWordSta
rt"], [[]]); | 61 testFindString("WebKit", "it", ["AtWordStarts", "TreatMedialCapitalAsWordSta
rt"], [[]]); |
62 testFindString("WebKit", "Kit", ["AtWordStarts", "TreatMedialCapitalAsWordSt
art"], [[3, 6], []]); | 62 testFindString("WebKit", "Kit", ["AtWordStarts", "TreatMedialCapitalAsWordSt
art"], [[3, 6], []]); |
63 testFindString("WebKit", "bKit", ["AtWordStarts", "TreatMedialCapitalAsWordS
tart"], [[]]); | 63 testFindString("WebKit", "bKit", ["AtWordStarts", "TreatMedialCapitalAsWordS
tart"], [[]]); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize)
+ thaiWords.join("") + bufferSizedString, thaiWords[0], ["AtWordStarts"], [[sear
chBufferUnoverlappedSize + 12, searchBufferUnoverlappedSize + 14], []]); | 104 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize)
+ thaiWords.join("") + bufferSizedString, thaiWords[0], ["AtWordStarts"], [[sear
chBufferUnoverlappedSize + 12, searchBufferUnoverlappedSize + 14], []]); |
105 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize -
1) + " " + thaiWords.join("") + bufferSizedString, thaiWords[0], ["AtWordStarts
"], [[searchBufferUnoverlappedSize, searchBufferUnoverlappedSize + 2], [searchBu
fferUnoverlappedSize + 12, searchBufferUnoverlappedSize + 14], []]); | 105 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize -
1) + " " + thaiWords.join("") + bufferSizedString, thaiWords[0], ["AtWordStarts
"], [[searchBufferUnoverlappedSize, searchBufferUnoverlappedSize + 2], [searchBu
fferUnoverlappedSize + 12, searchBufferUnoverlappedSize + 14], []]); |
106 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize -
3) + " " + thaiWords[4] + bufferSizedString, thaiWords[2], ["AtWordStarts"], [[
]]); | 106 testFindString(bufferSizedString.substring(0, searchBufferUnoverlappedSize -
3) + " " + thaiWords[4] + bufferSizedString, thaiWords[2], ["AtWordStarts"], [[
]]); |
107 | 107 |
108 testFindString("Spaces, the final frontier", " ", ["AtWordStarts"], [[7, 8],
[11, 12], [17, 18], []]); | 108 testFindString("Spaces, the final frontier", " ", ["AtWordStarts"], [[7, 8],
[11, 12], [17, 18], []]); |
109 testFindString("Use an @import rule", "@", ["AtWordStarts"], [[7, 8], []]); | 109 testFindString("Use an @import rule", "@", ["AtWordStarts"], [[7, 8], []]); |
110 testFindString("If ((x + 5) * 2) = 14, then x = 2", "(x", ["AtWordStarts"],
[[4, 6], []]); | 110 testFindString("If ((x + 5) * 2) = 14, then x = 2", "(x", ["AtWordStarts"],
[[4, 6], []]); |
111 | 111 |
112 document.getElementById("console").style.removeProperty("visibility"); | 112 document.getElementById("console").style.removeProperty("visibility"); |
113 </script> | 113 </script> |
OLD | NEW |