From 890a446ea201f882d79a21227928460d38f71206 Mon Sep 17 00:00:00 2001 From: Ankit Mahato Date: Fri, 8 Mar 2024 13:26:07 +0530 Subject: [PATCH] Fix test to check platform specific results --- test/utils/file_utils_test.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/utils/file_utils_test.dart b/test/utils/file_utils_test.dart index 35411d44..26e90e39 100644 --- a/test/utils/file_utils_test.dart +++ b/test/utils/file_utils_test.dart @@ -1,6 +1,6 @@ +import 'package:apidash/consts.dart'; import 'package:test/test.dart'; import 'package:apidash/utils/file_utils.dart'; -import 'package:path/path.dart' as p; void main() { group( @@ -12,8 +12,13 @@ void main() { }); test('Test getShortPath', () { - String path = "A/B/C/D.csv"; - expect(getShortPath(path), p.join("...", "C", "D.csv")); + if (kIsWindows) { + String path = r"A\B\C\D.csv"; + expect(getShortPath(path), r"...\C\D.csv"); + } else { + String path = "A/B/C/D.csv"; + expect(getShortPath(path), ".../C/D.csv"); + } }); test('Test getTempFileName', () {