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 /// Unit tests for comment map. | |
6 library commentMapTests; | |
7 | |
8 import 'dart:uri'; | |
9 import 'dart:mirrors'; | |
10 | |
11 import '../../compiler/implementation/scanner/scannerlib.dart' as dart2js; | |
12 | |
13 // TODO(rnystrom): Better path to unittest. | |
14 import '../../../../../pkg/unittest/lib/unittest.dart'; | |
15 | |
16 // TODO(rnystrom): Use "package:" URL (#4968). | |
17 part '../lib/src/dartdoc/comment_map.dart'; | |
18 | |
19 class FakeSourceLocation implements SourceLocation { | |
20 Uri get sourceUri => new Uri('file:///tmp/test.dart'); | |
21 int get offset => 69; | |
22 String get sourceText => """ | |
23 /// Testing | |
24 /// var testing = 'this is source code'; | |
25 get foo => 'bar'; | |
26 """; | |
27 } | |
28 | |
29 main() { | |
30 test('triple slashed comments retain newlines', () { | |
31 Commentmap cm = new CommentMap(); | |
32 var comment = cm.find(new FakeSourceLocation()); | |
33 expect( | |
34 comment, | |
35 equals("Testing\n var testing = 'this is source code';") | |
36 ); | |
37 }); | |
38 } | |
OLD | NEW |