OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'package:glob/glob.dart'; | 5 import 'package:glob/glob.dart'; |
6 import 'package:glob/src/utils.dart'; | 6 import 'package:glob/src/utils.dart'; |
7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:test/test.dart'; |
9 | 9 |
10 const RAW_ASCII_WITHOUT_SLASH = "\t\n\r !\"#\$%&'()*+`-.0123456789:;<=>?@ABCDEF" | 10 const RAW_ASCII_WITHOUT_SLASH = "\t\n\r !\"#\$%&'()*+`-.0123456789:;<=>?@ABCDEF" |
11 "GHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"; | 11 "GHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"; |
12 | 12 |
13 // URL-encode the path for a URL context. | 13 // URL-encode the path for a URL context. |
14 final asciiWithoutSlash = p.style == p.Style.url ? | 14 final asciiWithoutSlash = p.style == p.Style.url ? |
15 Uri.encodeFull(RAW_ASCII_WITHOUT_SLASH) : RAW_ASCII_WITHOUT_SLASH; | 15 Uri.encodeFull(RAW_ASCII_WITHOUT_SLASH) : RAW_ASCII_WITHOUT_SLASH; |
16 | 16 |
17 void main() { | 17 void main() { |
18 test("literals match exactly", () { | 18 test("literals match exactly", () { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 expect(r"http://foo.com/bar", | 285 expect(r"http://foo.com/bar", |
286 contains(new Glob("http://**", context: p.url))); | 286 contains(new Glob("http://**", context: p.url))); |
287 expect(r"http://foo.com/bar", | 287 expect(r"http://foo.com/bar", |
288 contains(new Glob("http://foo.com/**", context: p.url))); | 288 contains(new Glob("http://foo.com/**", context: p.url))); |
289 | 289 |
290 expect("/foo/bar", contains(new Glob("/foo/bar", context: p.url))); | 290 expect("/foo/bar", contains(new Glob("/foo/bar", context: p.url))); |
291 expect("/foo/bar", isNot(contains(new Glob("**", context: p.url)))); | 291 expect("/foo/bar", isNot(contains(new Glob("**", context: p.url)))); |
292 expect("/foo/bar", contains(new Glob("/**", context: p.url))); | 292 expect("/foo/bar", contains(new Glob("/**", context: p.url))); |
293 }); | 293 }); |
294 } | 294 } |
OLD | NEW |