]> gerrit.simantics Code Review - simantics/district.git/blob - shim.js
e4b93c407bc2b507ad55b40e42ffdcf8579fc885
[simantics/district.git] / shim.js
1 // In some parts copied from:
2 // http://closure-library.googlecode.com/svn/trunk/closure/goog/
3 // string/string_test.html
4
5 'use strict';
6
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");
16 };