Skip to content

Commit e0aa359

Browse files
committed
fix: compare paths as path objects not strings (Windows backslash compat)
1 parent 6ace80f commit e0aa359

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/unit/test_bmi_cache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ void writeFile(const std::filesystem::path& p, std::string_view body) {
4545

4646
TEST(BmiCache, KeyDirLayoutMatchesDocs26) {
4747
auto k = makeKey("/home/u/.mcpp");
48-
EXPECT_EQ(k.dir().string(),
49-
"/home/u/.mcpp/bmi/deadbeef0123abcd/deps/mcpplibs/mcpplibs.cmdline@0.0.1");
48+
auto expected = std::filesystem::path("/home/u/.mcpp/bmi/deadbeef0123abcd/deps/mcpplibs/mcpplibs.cmdline@0.0.1");
49+
EXPECT_EQ(k.dir(), expected);
5050
EXPECT_EQ(k.manifestFile().filename().string(), "manifest.txt");
5151
EXPECT_EQ(k.bmiDir().filename().string(), "gcm.cache");
5252
EXPECT_EQ(k.objDir().filename().string(), "obj");

tests/unit/test_manifest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ kind = "lib"
398398
EXPECT_TRUE(m->lib.path.empty());
399399
EXPECT_TRUE(mcpp::manifest::has_lib_target(*m));
400400
auto root = mcpp::manifest::resolve_lib_root_path(*m);
401-
EXPECT_EQ(root.string(), "src/tinyhttps.cppm");
401+
EXPECT_EQ(root, std::filesystem::path("src/tinyhttps.cppm"));
402402
}
403403

404404
TEST(Manifest, LibRootBareNameNoNamespace) {
@@ -412,7 +412,7 @@ kind = "lib"
412412
auto m = mcpp::manifest::parse_string(src);
413413
ASSERT_TRUE(m.has_value()) << m.error().format();
414414
auto root = mcpp::manifest::resolve_lib_root_path(*m);
415-
EXPECT_EQ(root.string(), "src/gtest.cppm");
415+
EXPECT_EQ(root, std::filesystem::path("src/gtest.cppm"));
416416
}
417417

418418
TEST(Manifest, LibRootExplicitOverride) {

0 commit comments

Comments
 (0)