Trying to fix unit test fails

This commit is contained in:
Matthias Koefferlein 2023-04-07 17:34:23 +02:00
parent 0802bc845d
commit 015263fb0e
2 changed files with 12 additions and 1 deletions

View File

@ -53,6 +53,7 @@
# include <dirent.h>
# include <libproc.h>
# include <dlfcn.h>
# include <pwd.h>
#else
@ -884,8 +885,10 @@ get_home_path ()
return tl::get_env ("HOMEDRIVE") + tl::get_env ("HOMEPATH");
} else if (tl::has_env ("HOMESHARE") && tl::has_env ("HOMEPATH")) {
return tl::get_env ("HOMESHARE") + tl::get_env ("HOMEPATH");
} else if (tl::has_env ("USERPROFILE")) {
return tl::get_env ("USERPROFILE");
}
tl::warn << tl::to_string (tr ("Unable to get home directory (no HOMEDRIVE/HOMEPATH or HOMESHARE/HOMEPATH environment variables)"));
tl::warn << tl::to_string (tr ("Unable to get home directory (no HOMEDRIVE/HOMEPATH, HOMESHARE/HOMEPATH or USERPROFILE environment variables)"));
#endif
return std::string (".");
}

View File

@ -186,6 +186,14 @@ END
rescue Exception => ex
msg = ex.message
end
# normalize paths for Windows
msg = msg.gsub("\\", "/")
input = input.gsub("\\", "/")
puts "INFO: msg is '#{msg}'"
puts "INFO: input is '#{input}'"
assert_equal(msg.sub(input, "<INPUT>"), "Nothing implemented in <INPUT>, line 22 in Netlist::read")
assert_equal(nl.description, "Read by MyDelegate")