shim.js 615 B

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