File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ String getShortPath(String path) {
43
43
var f = p.split (path);
44
44
if (f.length > 2 ) {
45
45
f = f.sublist (f.length - 2 );
46
- return ".../${ p .joinAll (f )}" ;
46
+ return p. join ( "..." , p.joinAll (f)) ;
47
47
}
48
48
return path;
49
49
}
Original file line number Diff line number Diff line change
1
+ import 'package:apidash/consts.dart' ;
1
2
import 'package:test/test.dart' ;
2
3
import 'package:apidash/utils/file_utils.dart' ;
3
4
@@ -11,8 +12,13 @@ void main() {
11
12
});
12
13
13
14
test ('Test getShortPath' , () {
14
- String path = "A/B/C/D.csv" ;
15
- expect (getShortPath (path), ".../C/D.csv" );
15
+ if (kIsWindows) {
16
+ String path = r"A\B\C\D.csv" ;
17
+ expect (getShortPath (path), r"...\C\D.csv" );
18
+ } else {
19
+ String path = "A/B/C/D.csv" ;
20
+ expect (getShortPath (path), ".../C/D.csv" );
21
+ }
16
22
});
17
23
18
24
test ('Test getTempFileName' , () {
You can’t perform that action at this time.
0 commit comments