From c6e7ffbe5ec3565350cc38facfed43e6b0bf3cba Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Tue, 9 Jul 2024 14:06:42 +0800 Subject: [PATCH] Test different OS --- test/xy.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/xy.c b/test/xy.c index 6a5daa7..8cfe049 100644 --- a/test/xy.c +++ b/test/xy.c @@ -5,7 +5,7 @@ * License : MIT * Authors : Aoran Zeng * Created on : <2023-08-30> - * Last modified : <2024-06-21> + * Last modified : <2024-07-09> * * 测试 xy.h * ------------------------------------------------------------*/ @@ -85,8 +85,19 @@ main (int argc, char const *argv[]) assert (xy_file_exist ("./image/chsrc.png")); - assert (xy_file_exist (xy_win_powershell_profile)); - assert (true == xy_file_exist (xy_win_powershellv5_profile)); + assert (xy_dir_exist ("~")); + if (xy_on_windows) + { + assert (xy_file_exist (xy_win_powershell_profile)); + assert (true == xy_file_exist (xy_win_powershellv5_profile)); + assert (xy_dir_exist ("C:\\Users")); + } + else + { + assert (xy_file_exist ("~/.bashrc")); + assert (xy_dir_exist ("/etc")); + } + puts (xy_uniform_path (" \n ~/haha/test/123 \n\r ")); assert_str (xy_uniform_path ("~/haha/test"), xy_parent_dir (" ~/haha/test/123"));