shim.js 526 B

1234567891011121314
  1. // Inspired and 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', 'ab'), true, "Starts with needle");
  8. a(t.call('abcd', 'abcd'), true, "Needle equals haystack");
  9. a(t.call('abcd', 'bcde', 1), false, "Needle larger than haystack");
  10. a(!t.call('abcd', 'cd'), true, "Doesn't start with needle");
  11. a(t.call('abcd', 'bc', 1), true, "Position");
  12. };