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 /// Unit tests for doc. | 5 /// Unit tests for doc. |
6 #library('dartdoc_tests'); | 6 #library('dartdoc_tests'); |
7 | 7 |
8 // TODO(rnystrom): Use "package:" URL (#4968). | 8 // TODO(rnystrom): Use "package:" URL (#4968). |
9 #import('../lib/dartdoc.dart', prefix: 'dd'); | 9 #import('../lib/dartdoc.dart', prefix: 'dd'); |
10 #import('../lib/markdown.dart', prefix: 'md'); | 10 #import('../lib/markdown.dart', prefix: 'md'); |
11 #import('../../unittest/lib/unittest.dart'); | 11 |
| 12 // TODO(rnystrom): Better path to unittest. |
| 13 #import('../../unittest/unittest.dart'); |
12 | 14 |
13 main() { | 15 main() { |
14 group('countOccurrences', () { | 16 group('countOccurrences', () { |
15 test('empty text returns 0', () { | 17 test('empty text returns 0', () { |
16 expect(dd.countOccurrences('', 'needle'), equals(0)); | 18 expect(dd.countOccurrences('', 'needle'), equals(0)); |
17 }); | 19 }); |
18 | 20 |
19 test('one occurrence', () { | 21 test('one occurrence', () { |
20 expect(dd.countOccurrences('bananarama', 'nara'), equals(1)); | 22 expect(dd.countOccurrences('bananarama', 'nara'), equals(1)); |
21 }); | 23 }); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 '../../other/sub/file.html')); | 110 '../../other/sub/file.html')); |
109 }); | 111 }); |
110 | 112 |
111 test('from nested to directory with different path', () { | 113 test('from nested to directory with different path', () { |
112 doc.startFile('dir/sub/file.html'); | 114 doc.startFile('dir/sub/file.html'); |
113 expect(doc.relativePath('other/file.html'), equals( | 115 expect(doc.relativePath('other/file.html'), equals( |
114 '../../other/file.html')); | 116 '../../other/file.html')); |
115 }); | 117 }); |
116 }); | 118 }); |
117 } | 119 } |
OLD | NEW |