linqts
Version:
LinQ + TypeScript
15 lines • 510 B
JavaScript
import test from 'ava';
import Enumerable from '../src/enumerable.js';
test('Range', function (t) {
t.deepEqual(Enumerable.Range(1, 10)
.Select(function (x) { return x * x; })
.ToArray(), [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]);
});
test('Repeat', function (t) {
var str = 'I like programming';
var test = Enumerable.Repeat(str, 3);
t.is(test.ElementAt(0), str);
t.is(test.ElementAt(1), str);
t.is(test.ElementAt(2), str);
});
//# sourceMappingURL=enumerable.test.js.map