Skip to content

Commit

Permalink
Make fw pass on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ccmywish committed Dec 14, 2024
1 parent 22c2bc6 commit edb5907
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ main (int argc, char const *argv[])
say (Chsrc_Version);
return 0;
}
xy_useutf8();

br();
chsrc_log ("chsrc_log");
Expand All @@ -38,11 +39,16 @@ main (int argc, char const *argv[])
chsrc_debug2 ("chsrc_debug2");
chsrc_verbose2 ("chsrc_verbose2");

#ifdef XY_On_Windows
#define fw ".\\fw.exe"
#else
#define fw "./fw"
#endif

assert (chsrc_check_program ("./fw"));
assert (chsrc_check_program_quietly ("./fw"));
assert (chsrc_check_program_quietly_when_exist ("./fw"));
chsrc_ensure_program ("./fw");
assert (chsrc_check_program (fw));
assert (chsrc_check_program_quietly (fw));
assert (chsrc_check_program_quietly_when_exist (fw));
chsrc_ensure_program (fw);

#define bkup "README.md.bak"

Expand All @@ -52,7 +58,10 @@ main (int argc, char const *argv[])
chsrc_ensure_dir ("test");

chsrc_append_to_file ("append", bkup);
chsrc_prepend_to_file ("prepend", bkup);
if (!xy_on_windows)
{
chsrc_prepend_to_file ("prepend", bkup);
}
chsrc_overwrite_file ("overwrite", bkup);
chsrc_view_file (bkup);

Expand Down

0 comments on commit edb5907

Please sign in to comment.