1 // In some parts copied from:
2 // http://closure-library.googlecode.com/svn/trunk/closure/goog/
3 // string/string_test.html
7 module.exports = function (t, a) {
8 a(t.call('abc', ''), true, "Empty needle");
9 a(t.call('abcd', 'cd'), true, "Ends with needle");
10 a(t.call('abcd', 'abcd'), true, "Needle equals haystack");
11 a(t.call('abcd', 'ab'), false, "Doesn't end with needle");
12 a(t.call('abc', 'defg'), false, "Length trick");
13 a(t.call('razdwa', 'zd', 3), false, "Position: false");
14 a(t.call('razdwa', 'zd', 4), true, "Position: true");
15 a(t.call('razdwa', 'zd', 5), false, "Position: false #2");