OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #library('util_tests'); | 5 #library('util_tests'); |
6 | 6 |
7 #import('dart:html'); | 7 #import('dart:html'); |
8 #import('../../../../../../client/testing/unittest/unittest.dart'); | 8 #import('../../../../../../client/testing/unittest/unittest_html.dart'); |
9 #import('../../../../../ui_lib/util/utilslib.dart'); | 9 #import('../../../../../ui_lib/util/utilslib.dart'); |
10 | 10 |
11 main() { | 11 main() { |
12 test('insertAt', () { | 12 test('insertAt', () { |
13 var a = []; | 13 var a = []; |
14 CollectionUtils.insertAt(a, 0, 1); | 14 CollectionUtils.insertAt(a, 0, 1); |
15 expect(a).equalsCollection([1]); | 15 expect(a).equalsCollection([1]); |
16 | 16 |
17 CollectionUtils.insertAt(a, 0, 2); | 17 CollectionUtils.insertAt(a, 0, 2); |
18 expect(a).equalsCollection([2, 1]); | 18 expect(a).equalsCollection([2, 1]); |
(...skipping 15 matching lines...) Expand all Loading... |
34 CollectionUtils.insertAt(a, 3, 5); | 34 CollectionUtils.insertAt(a, 3, 5); |
35 expect(a).equalsCollection([1, 3, 2, 5, 4]); | 35 expect(a).equalsCollection([1, 3, 2, 5, 4]); |
36 }); | 36 }); |
37 | 37 |
38 test('defaultString', () { | 38 test('defaultString', () { |
39 expect(StringUtils.defaultString(null)).equals(''); | 39 expect(StringUtils.defaultString(null)).equals(''); |
40 expect(StringUtils.defaultString('')).equals(''); | 40 expect(StringUtils.defaultString('')).equals(''); |
41 expect(StringUtils.defaultString('test')).equals('test'); | 41 expect(StringUtils.defaultString('test')).equals('test'); |
42 }); | 42 }); |
43 } | 43 } |
OLD | NEW |