OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** Tests for some of the utility helper functions used by the compiler. */ | 5 /** Tests for some of the utility helper functions used by the compiler. */ |
6 library utils_test; | 6 library utils_test; |
7 | 7 |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
9 import 'package:unittest/vm_config.dart'; | 9 import 'package:unittest/vm_config.dart'; |
10 import 'package:web_components/src/utils.dart'; | 10 import 'package:web_ui/src/utils.dart'; |
11 | 11 |
12 main() { | 12 main() { |
13 useVmConfiguration(); | 13 useVmConfiguration(); |
14 | 14 |
15 for (bool startUppercase in [false, true]) { | 15 for (bool startUppercase in [false, true]) { |
16 Matcher caseEquals(String str) { | 16 Matcher caseEquals(String str) { |
17 if (startUppercase) str = str[0].toUpperCase().concat(str.substring(1)); | 17 if (startUppercase) str = str[0].toUpperCase().concat(str.substring(1)); |
18 return equals(str); | 18 return equals(str); |
19 } | 19 } |
20 | 20 |
(...skipping 26 matching lines...) Expand all Loading... |
47 }); | 47 }); |
48 | 48 |
49 test('consecutive dashes', () { | 49 test('consecutive dashes', () { |
50 expect(camelCase('--hi-friend'), caseEquals('HiFriend')); | 50 expect(camelCase('--hi-friend'), caseEquals('HiFriend')); |
51 expect(camelCase('hi--friend'), caseEquals('hiFriend')); | 51 expect(camelCase('hi--friend'), caseEquals('hiFriend')); |
52 expect(camelCase('hi-friend--'), caseEquals('hiFriend')); | 52 expect(camelCase('hi-friend--'), caseEquals('hiFriend')); |
53 }); | 53 }); |
54 }); | 54 }); |
55 } | 55 } |
56 } | 56 } |
OLD | NEW |