Compare source-open Unicode argv against canonical paths
Native and manual checks / native (ubuntu-24.04) (push) Failing after 30s
Native and manual checks / manual (push) Successful in 28s
Windows editor and software Vulkan / windows-graphics (push) Canceled after 0s
Native and manual checks / native (windows-2025) (push) Canceled after 0s
Native and manual checks / native (ubuntu-24.04) (push) Failing after 30s
Native and manual checks / manual (push) Successful in 28s
Windows editor and software Vulkan / windows-graphics (push) Canceled after 0s
Native and manual checks / native (windows-2025) (push) Canceled after 0s
This commit is contained in:
@@ -177,12 +177,17 @@ int test_main(int argc, char** argv) {
|
|||||||
"{file}:{line}:{column}", "{project}"})}});
|
"{file}:{line}:{column}", "{project}"})}});
|
||||||
for (int attempt = 0; attempt < 100 && !std::filesystem::exists(probe); ++attempt)
|
for (int attempt = 0; attempt < 100 && !std::filesystem::exists(probe); ++attempt)
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
|
const auto canonical_root = std::filesystem::weakly_canonical(root);
|
||||||
|
const auto expected_source = project_path(root, "Scripts/Gameplay.cpp");
|
||||||
|
const auto expected_arguments =
|
||||||
|
Json::array({path_to_utf8(expected_source) + ":17:4", path_to_utf8(canonical_root)});
|
||||||
|
const auto actual_arguments =
|
||||||
|
std::filesystem::is_regular_file(probe) ? read_json(probe) : Json(nullptr);
|
||||||
require(opened.at("path") == "Scripts/Gameplay.cpp" && opened.at("line") == 17 &&
|
require(opened.at("path") == "Scripts/Gameplay.cpp" && opened.at("line") == 17 &&
|
||||||
std::filesystem::is_regular_file(probe) &&
|
actual_arguments == expected_arguments,
|
||||||
read_json(probe) ==
|
"test", "Source navigation passes a Unicode path and location as literal argv; "
|
||||||
Json::array({path_to_utf8(root / "Scripts/Gameplay.cpp") + ":17:4",
|
"expected " + expected_arguments.dump() + ", got " +
|
||||||
path_to_utf8(root)}),
|
actual_arguments.dump());
|
||||||
"test", "Source navigation passes a Unicode path and location as literal argv");
|
|
||||||
reject_command("faset_source_open", {{"path", "../outside.cpp"}}, "source.path");
|
reject_command("faset_source_open", {{"path", "../outside.cpp"}}, "source.path");
|
||||||
reject_command("faset_source_open", {{"path", "Scripts/missing.cpp"}}, "source.path");
|
reject_command("faset_source_open", {{"path", "Scripts/missing.cpp"}}, "source.path");
|
||||||
reject_command("faset_source_open", {{"path", "Scripts"}}, "source.path");
|
reject_command("faset_source_open", {{"path", "Scripts"}}, "source.path");
|
||||||
@@ -233,7 +238,7 @@ int test_main(int argc, char** argv) {
|
|||||||
"configuration preservation and Lua editor commands passed\n";
|
"configuration preservation and Lua editor commands passed\n";
|
||||||
return 0;
|
return 0;
|
||||||
} catch (const std::exception& error) {
|
} catch (const std::exception& error) {
|
||||||
std::cerr << error.what() << "\nFixture retained at " << root << '\n';
|
std::cerr << error.what() << "\nFixture retained at " << path_to_utf8(root) << '\n';
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user