Files
kichikuou d4121032db system.ExistFile() should return false if path ends with a backslash
The system.ExistsFile() system call returns 1 if a file or directory
exists, but returns 0 when the provided path ends with a directory
separator, regardless of whether a directory exists at that location.

This subtle difference in behavior caused problems in Pastel Chime 3.
2026-03-07 11:31:43 +09:00

9 lines
287 B
C

// -*-mode: C; coding: sjis; -*-
void test_system(void)
{
string savedir = system.GetSaveFolderName();
test_equal("system.ExistFile(savedir) == 1", system.ExistFile(savedir), 1);
test_equal("system.ExistFile(savedir + \"\\\\\") == 1", system.ExistFile(savedir + "\\"), 0);
}