Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/include/dire/project.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IReallyWantMyOwnPlatformProjectName
/**
* This class stores the platform-specific project name, which is used as a subpath for the project directories.
*
* It should be obtained via a call to `dire::project::name()`, which returns a name standarized for the build platform.
* It should be obtained via a call to `dire::name()`, which returns a name standarized for the build platform.
*
* If you **REALLY** want to enforce your own name, initialize it by using `IReallyWantMyOwnPlatformProjectName`.
*
Expand Down
2 changes: 1 addition & 1 deletion src/lib/src/dire/windows/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ auto name(std::string domain, [[maybe_unused]] std::string org, std::string app_
);

return PlatformProjectName(
Path(detail::trim(std::move(domain))) / Path(detail::trim(std::move(app_name)))
Path(detail::trim(std::move(org))) / Path(detail::trim(std::move(app_name)))
);
}

Expand Down
18 changes: 9 additions & 9 deletions src/test/windows/project_dirs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ TEST_CASE("name() normalizes name for platform", "[project_dirs]")
{
using dire::Path;

REQUIRE(static_cast<Path>(dire::name("baz", "bar", "foo")) == "baz\\foo");
REQUIRE(static_cast<Path>(dire::name(" F o o", "foo", " BaZ ")) == "F o o\\BaZ");
REQUIRE(static_cast<Path>(dire::name("domain", "x", " baz -az ")) == "domain\\baz -az");
REQUIRE(static_cast<Path>(dire::name("baz", "bar", "foo")) == "bar\\foo");
REQUIRE(static_cast<Path>(dire::name("foo", " F o o", " BaZ ")) == "F o o\\BaZ");
REQUIRE(static_cast<Path>(dire::name("domain", "x", " baz -az ")) == "x\\baz -az");
}

TEST_CASE("name() respects IReallyWantMyOwnPlatformProjectName", "[project_dirs]")
Expand All @@ -24,12 +24,12 @@ TEST_CASE("Dir functions respect name", "[project_dirs]")
{
auto name = dire::name("domain", "org", " a _p - p ");

REQUIRE(dire::config_dir(name)->string().ends_with("domain\\a _p - p\\config"));
REQUIRE(dire::data_dir(name)->string().ends_with("domain\\a _p - p\\data"));
REQUIRE(dire::cache_dir(name)->string().ends_with("domain\\a _p - p\\cache"));
REQUIRE(dire::data_local_dir(name)->string().ends_with("domain\\a _p - p\\data"));
REQUIRE(dire::config_local_dir(name)->string().ends_with("domain\\a _p - p\\config"));
REQUIRE(dire::preference_dir(name)->string().ends_with("domain\\a _p - p\\config"));
REQUIRE(dire::config_dir(name)->string().ends_with("org\\a _p - p\\config"));
REQUIRE(dire::data_dir(name)->string().ends_with("org\\a _p - p\\data"));
REQUIRE(dire::cache_dir(name)->string().ends_with("org\\a _p - p\\cache"));
REQUIRE(dire::data_local_dir(name)->string().ends_with("org\\a _p - p\\data"));
REQUIRE(dire::config_local_dir(name)->string().ends_with("org\\a _p - p\\config"));
REQUIRE(dire::preference_dir(name)->string().ends_with("org\\a _p - p\\config"));

REQUIRE(not dire::runtime_dir(name));
REQUIRE(not dire::state_dir(name));
Expand Down