1
- // Copyright (c) 2016 , the Dart project authors. Please see the AUTHORS file
1
+ // Copyright (c) 2019 , the Dart project authors. Please see the AUTHORS file
2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
@@ -7,9 +7,9 @@ library dartdoc.cache_test;
7
7
import 'dart:io' ;
8
8
9
9
import 'package:dartdoc/src/line_number_cache.dart' ;
10
- import 'package:path/path.dart' as pathLib;
11
- import 'package:test/test.dart' ;
12
10
import 'package:dartdoc/src/tuple.dart' ;
11
+ import 'package:path/path.dart' as path;
12
+ import 'package:test/test.dart' ;
13
13
14
14
void main () {
15
15
group ('Verify basic line cache behavior' , () {
@@ -24,15 +24,15 @@ void main() {
24
24
});
25
25
26
26
test ('validate empty file behavior' , () {
27
- File emptyFile = File (pathLib .join (_tempDir.path, 'empty_file' ))
27
+ File emptyFile = File (path .join (_tempDir.path, 'empty_file' ))
28
28
..writeAsStringSync ('' );
29
29
LineNumberCache cache = LineNumberCache ();
30
30
expect (cache.lineAndColumn (emptyFile.path, 0 ), equals (Tuple2 (1 , 0 )));
31
31
});
32
32
33
33
test ('single line without newline' , () {
34
34
File singleLineWithoutNewline =
35
- File (pathLib .join (_tempDir.path, 'single_line' ))
35
+ File (path .join (_tempDir.path, 'single_line' ))
36
36
..writeAsStringSync ('a single line' );
37
37
LineNumberCache cache = LineNumberCache ();
38
38
expect (cache.lineAndColumn (singleLineWithoutNewline.path, 2 ),
@@ -42,7 +42,7 @@ void main() {
42
42
});
43
43
44
44
test ('multiple line without trailing newline' , () {
45
- File multipleLine = File (pathLib .join (_tempDir.path, 'multiple_line' ))
45
+ File multipleLine = File (path .join (_tempDir.path, 'multiple_line' ))
46
46
..writeAsStringSync ('This is the first line\n This is the second line' );
47
47
LineNumberCache cache = LineNumberCache ();
48
48
expect (cache.lineAndColumn (multipleLine.path, 60 ), equals (Tuple2 (2 , 38 )));
@@ -52,7 +52,7 @@ void main() {
52
52
});
53
53
54
54
test ('multiple lines with trailing newline' , () {
55
- File multipleLine = File (pathLib .join (_tempDir.path, 'multiple_line' ))
55
+ File multipleLine = File (path .join (_tempDir.path, 'multiple_line' ))
56
56
..writeAsStringSync (
57
57
'This is the first line\n This is the second line\n ' );
58
58
LineNumberCache cache = LineNumberCache ();
0 commit comments