Lines Matching full:indexof
30 assertEquals(0, s.indexOf("t"));
31 assertEquals(3, s.indexOf("t", 1));
32 assertEquals(5, s.indexOf("t", 4));
33 assertEquals(1, s.indexOf("e"));
34 assertEquals(2, s.indexOf("s"));
36 assertEquals(5, s.indexOf("test", 4));
37 assertEquals(5, s.indexOf("test", 5));
38 assertEquals(10, s.indexOf("test", 6));
39 assertEquals(0, s.indexOf("test", 0));
40 assertEquals(0, s.indexOf("test", -1));
41 assertEquals(0, s.indexOf("test"));
42 assertEquals(-1, s.indexOf("notpresent"));
43 assertEquals(-1, s.indexOf());
47 assertEquals(expected, s.indexOf("", i));
52 assertEquals(4, reString.indexOf("[a-z]+"));
53 assertEquals(10, reString.indexOf("(asdf)?"));
55 assertEquals(1, String.prototype.indexOf.length);
61 assertEquals(0, twoByteString.indexOf("\u039a"), "Lamda");
62 assertEquals(1, twoByteString.indexOf("\u0391"), "Alpha");
63 assertEquals(2, twoByteString.indexOf("\u03a3"), "First Sigma");
64 assertEquals(3, twoByteString.indexOf("\u03a3",3), "Second Sigma");
65 assertEquals(4, twoByteString.indexOf("\u0395"), "Epsilon");
66 assertEquals(-1, twoByteString.indexOf("\u0392"), "Not beta");
69 assertEquals(0, twoByteString.indexOf("\u039a\u0391"), "lambda Alpha");
70 assertEquals(1, twoByteString.indexOf("\u0391\u03a3"), "Alpha Sigma");
71 assertEquals(2, twoByteString.indexOf("\u03a3\u03a3"), "Sigma Sigma");
72 assertEquals(3, twoByteString.indexOf("\u03a3\u0395"), "Sigma Epsilon");
74 assertEquals(-1, twoByteString.indexOf("\u0391\u03a3\u0395"),
78 assertEquals(4, twoByteString.indexOf("\u0395"));
82 assertEquals(2, alignmentString.indexOf("\u2222"));
83 assertEquals(4, alignmentString.indexOf("\u00FF\u00FF"));
87 longAlignmentString.indexOf("\u00FF".repeat(10)));
91 assertEquals(-1, boundsString.indexOf("334455"));
92 assertEquals(-1, boundsString.indexOf("334455".repeat(10)));
94 // Test complex string indexOf algorithms. Only trigger for long strings.
105 var index = long.indexOf(pattern, i);
108 assertEquals(510, long.indexOf("AJABACA"), "Long AJABACA, First J");
109 assertEquals(1534, long.indexOf("AJABACA", 511), "Long AJABACA, Second J");
112 assertEquals(511, long.indexOf(pattern), "Long JABACABA..., First J");
113 assertEquals(1535, long.indexOf(pattern, 512), "Long JABACABA..., Second J");
118 assertEquals(-1, asciiString.indexOf("\x2061"));
127 assertEquals(-1, allCharsString.indexOf("notfound"));
137 assertEquals(index, allCharsString.indexOf(pattern));