| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.test.src.util.glob_test; | 5 library analyzer.test.src.util.glob_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/util/glob.dart'; | 7 import 'package:analyzer/src/util/glob.dart'; |
| 8 import 'package:test/test.dart'; |
| 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 9 import 'package:unittest/unittest.dart'; | |
| 10 | 10 |
| 11 import '../../utils.dart'; | 11 import '../../utils.dart'; |
| 12 | 12 |
| 13 main() { | 13 main() { |
| 14 initializeTestEnvironment(); | 14 initializeTestEnvironment(); |
| 15 defineReflectiveTests(GlobPosixTest); | 15 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(GlobWindowsTest); | 16 defineReflectiveTests(GlobPosixTest); |
| 17 defineReflectiveTests(GlobWindowsTest); |
| 18 }); |
| 17 } | 19 } |
| 18 | 20 |
| 19 @reflectiveTest | 21 @reflectiveTest |
| 20 class GlobPosixTest { | 22 class GlobPosixTest { |
| 21 void test_case() { | 23 void test_case() { |
| 22 Glob glob = new Glob(r'\', r'**.DaRt'); | 24 Glob glob = new Glob(r'\', r'**.DaRt'); |
| 23 expect(glob.matches(r'aaa.dart'), isTrue); | 25 expect(glob.matches(r'aaa.dart'), isTrue); |
| 24 expect(glob.matches(r'bbb.DART'), isTrue); | 26 expect(glob.matches(r'bbb.DART'), isTrue); |
| 25 expect(glob.matches(r'ccc.dArT'), isTrue); | 27 expect(glob.matches(r'ccc.dArT'), isTrue); |
| 26 expect(glob.matches(r'ddd.DaRt'), isTrue); | 28 expect(glob.matches(r'ddd.DaRt'), isTrue); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void test_starStar() { | 126 void test_starStar() { |
| 125 Glob glob = new Glob(r'\', r'**.dart'); | 127 Glob glob = new Glob(r'\', r'**.dart'); |
| 126 expect(glob.matches(r'foo\bar.dart'), isTrue); | 128 expect(glob.matches(r'foo\bar.dart'), isTrue); |
| 127 expect(glob.matches(r'foo\bar\baz.dart'), isTrue); | 129 expect(glob.matches(r'foo\bar\baz.dart'), isTrue); |
| 128 expect(glob.matches(r'C:\foo\bar.dart'), isTrue); | 130 expect(glob.matches(r'C:\foo\bar.dart'), isTrue); |
| 129 expect(glob.matches(r'C:\foo\bar\baz.dart'), isTrue); | 131 expect(glob.matches(r'C:\foo\bar\baz.dart'), isTrue); |
| 130 // does not end with 'dart' | 132 // does not end with 'dart' |
| 131 expect(glob.matches(r'C:\web\foo.html'), isFalse); | 133 expect(glob.matches(r'C:\web\foo.html'), isFalse); |
| 132 } | 134 } |
| 133 } | 135 } |
| OLD | NEW |