OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library lock_file_test; |
| 6 |
| 7 import '../../../pkg/unittest/lib/unittest.dart'; |
| 8 import '../../pub/directory_tree.dart'; |
| 9 |
| 10 main() { |
| 11 test('no files', () { |
| 12 expect(generateTree([]), equals("")); |
| 13 }); |
| 14 |
| 15 test('up to ten files in one directory are shown', () { |
| 16 var files = [ |
| 17 "a.dart", |
| 18 "b.dart", |
| 19 "c.dart", |
| 20 "d.dart", |
| 21 "e.dart", |
| 22 "f.dart", |
| 23 "g.dart", |
| 24 "h.dart", |
| 25 "i.dart", |
| 26 "j.dart" |
| 27 ]; |
| 28 expect(generateTree(files), equals(""" |
| 29 |-- a.dart |
| 30 |-- b.dart |
| 31 |-- c.dart |
| 32 |-- d.dart |
| 33 |-- e.dart |
| 34 |-- f.dart |
| 35 |-- g.dart |
| 36 |-- h.dart |
| 37 |-- i.dart |
| 38 '-- j.dart |
| 39 """)); |
| 40 }); |
| 41 |
| 42 test('files are elided if there are more than ten', () { |
| 43 var files = [ |
| 44 "a.dart", |
| 45 "b.dart", |
| 46 "c.dart", |
| 47 "d.dart", |
| 48 "e.dart", |
| 49 "f.dart", |
| 50 "g.dart", |
| 51 "h.dart", |
| 52 "i.dart", |
| 53 "j.dart", |
| 54 "k.dart" |
| 55 ]; |
| 56 expect(generateTree(files), equals(""" |
| 57 |-- a.dart |
| 58 |-- b.dart |
| 59 |-- c.dart |
| 60 | (5 more...) |
| 61 |-- i.dart |
| 62 |-- j.dart |
| 63 '-- k.dart |
| 64 """)); |
| 65 }); |
| 66 |
| 67 test('a complex example', () { |
| 68 var files = [ |
| 69 "TODO", |
| 70 "example/console_example.dart", |
| 71 "example/main.dart", |
| 72 "example/web copy/web_example.dart", |
| 73 "test/absolute_test.dart", |
| 74 "test/basename_test.dart", |
| 75 "test/dirname_test.dart", |
| 76 "test/extension_test.dart", |
| 77 "test/is_absolute_test.dart", |
| 78 "test/is_relative_test.dart", |
| 79 "test/join_test.dart", |
| 80 "test/normalize_test.dart", |
| 81 "test/relative_test.dart", |
| 82 "test/split_test.dart", |
| 83 ".gitignore", |
| 84 "README.md", |
| 85 "lib/path.dart", |
| 86 "pubspec.yaml", |
| 87 "test/all_test.dart", |
| 88 "test/path_posix_test.dart", |
| 89 "test/path_windows_test.dart" |
| 90 ]; |
| 91 |
| 92 expect(generateTree(files), equals(""" |
| 93 |-- .gitignore |
| 94 |-- README.md |
| 95 |-- TODO |
| 96 |-- example |
| 97 | |-- console_example.dart |
| 98 | |-- main.dart |
| 99 | '-- web copy |
| 100 | '-- web_example.dart |
| 101 |-- lib |
| 102 | '-- path.dart |
| 103 |-- pubspec.yaml |
| 104 '-- test |
| 105 |-- absolute_test.dart |
| 106 |-- all_test.dart |
| 107 |-- basename_test.dart |
| 108 | (7 more...) |
| 109 |-- path_windows_test.dart |
| 110 |-- relative_test.dart |
| 111 '-- split_test.dart |
| 112 """)); |
| 113 }); |
| 114 } |
OLD | NEW |