Skip to content

Commit 890a446

Browse files
committed
Fix test to check platform specific results
1 parent 744157d commit 890a446

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/utils/file_utils_test.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import 'package:apidash/consts.dart';
12
import 'package:test/test.dart';
23
import 'package:apidash/utils/file_utils.dart';
3-
import 'package:path/path.dart' as p;
44

55
void main() {
66
group(
@@ -12,8 +12,13 @@ void main() {
1212
});
1313

1414
test('Test getShortPath', () {
15-
String path = "A/B/C/D.csv";
16-
expect(getShortPath(path), p.join("...", "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+
}
1722
});
1823

1924
test('Test getTempFileName', () {

0 commit comments

Comments
 (0)