| Index: client/tests/client/util/util_tests.dart
|
| diff --git a/client/tests/client/util/util_tests.dart b/client/tests/client/util/util_tests.dart
|
| index 30a0034da5113c0a0a8a6426bb18a9a2832fb40f..562abf0e42cc9ee247f69020d28134c6ed78de15 100644
|
| --- a/client/tests/client/util/util_tests.dart
|
| +++ b/client/tests/client/util/util_tests.dart
|
| @@ -4,49 +4,41 @@
|
|
|
| #library('util_tests');
|
|
|
| -#import('dart:html');
|
| +#import('dart:html'); // TODO(rnystrom): Only needed to tell architecture.py
|
| + // that this is a web test. Come up with cleaner solution.
|
| #import('../../../testing/unittest/unittest.dart');
|
| #import('../../../util/utilslib.dart');
|
|
|
| main() {
|
| - new UtilsTests().run();
|
| -}
|
| -
|
| -class UtilsTests extends UnitTestSuite {
|
| -
|
| - UtilsTests() : super() {}
|
| -
|
| - void setUpTestSuite() {
|
| - addTest(void testInsertAt() {
|
| - List a = new List();
|
| - CollectionUtils.insertAt(a, 0, 1);
|
| - Expect.listEquals([1], a);
|
| -
|
| - CollectionUtils.insertAt(a, 0, 2);
|
| - Expect.listEquals([2, 1], a);
|
| -
|
| - CollectionUtils.insertAt(a, 0, 5);
|
| - CollectionUtils.insertAt(a, 0, 4);
|
| - CollectionUtils.insertAt(a, 0, 3);
|
| - Expect.listEquals([3, 4, 5, 2, 1], a);
|
| -
|
| - a = new List();
|
| - CollectionUtils.insertAt(a, 0, 1);
|
| - Expect.listEquals([1], a);
|
| -
|
| - CollectionUtils.insertAt(a, 1, 2);
|
| - Expect.listEquals([1, 2], a);
|
| -
|
| - CollectionUtils.insertAt(a, 1, 3);
|
| - CollectionUtils.insertAt(a, 3, 4);
|
| - CollectionUtils.insertAt(a, 3, 5);
|
| - Expect.listEquals([1, 3, 2, 5, 4], a);
|
| - });
|
| -
|
| - addTest(void testDefaultString() {
|
| - Expect.equals('', StringUtils.defaultString(null));
|
| - Expect.equals('', StringUtils.defaultString(''));
|
| - Expect.equals('test', StringUtils.defaultString('test'));
|
| - });
|
| - }
|
| + test('insertAt', () {
|
| + var a = [];
|
| + CollectionUtils.insertAt(a, 0, 1);
|
| + expect(a).equalsCollection([1]);
|
| +
|
| + CollectionUtils.insertAt(a, 0, 2);
|
| + expect(a).equalsCollection([2, 1]);
|
| +
|
| + CollectionUtils.insertAt(a, 0, 5);
|
| + CollectionUtils.insertAt(a, 0, 4);
|
| + CollectionUtils.insertAt(a, 0, 3);
|
| + expect(a).equalsCollection([3, 4, 5, 2, 1]);
|
| +
|
| + a = [];
|
| + CollectionUtils.insertAt(a, 0, 1);
|
| + expect(a).equalsCollection([1]);
|
| +
|
| + CollectionUtils.insertAt(a, 1, 2);
|
| + expect(a).equalsCollection([1, 2]);
|
| +
|
| + CollectionUtils.insertAt(a, 1, 3);
|
| + CollectionUtils.insertAt(a, 3, 4);
|
| + CollectionUtils.insertAt(a, 3, 5);
|
| + expect(a).equalsCollection([1, 3, 2, 5, 4]);
|
| + });
|
| +
|
| + test('defaultString', () {
|
| + expect(StringUtils.defaultString(null)).equals('');
|
| + expect(StringUtils.defaultString('')).equals('');
|
| + expect(StringUtils.defaultString('test')).equals('test');
|
| + });
|
| }
|
|
|