diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-02-22 17:03:21 +0100 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-02-22 17:03:21 +0100 |
commit | 619def44c1cca9f3cdf63544d5f24f2c7a7d9b77 (patch) | |
tree | 01868de723cb82c86842f33743fa7b14e24c1fa3 /test/buildtool/build_engine/base_maps/entity_name.test.cpp | |
download | justbuild-619def44c1cca9f3cdf63544d5f24f2c7a7d9b77.tar.gz |
Initial self-hosting commit
This is the initial version of our tool that is able to
build itself. In can be bootstrapped by
./bin/bootstrap.py
Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com>
Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>
Diffstat (limited to 'test/buildtool/build_engine/base_maps/entity_name.test.cpp')
-rw-r--r-- | test/buildtool/build_engine/base_maps/entity_name.test.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/buildtool/build_engine/base_maps/entity_name.test.cpp b/test/buildtool/build_engine/base_maps/entity_name.test.cpp new file mode 100644 index 00000000..ddcea10b --- /dev/null +++ b/test/buildtool/build_engine/base_maps/entity_name.test.cpp @@ -0,0 +1,22 @@ +#include "catch2/catch.hpp" +#include "src/buildtool/build_engine/base_maps/entity_name.hpp" + +TEST_CASE("Normal module names") { + using EN = BuildMaps::Base::EntityName; + CHECK(EN::normal_module_name("foo/bar") == "foo/bar"); + CHECK(EN::normal_module_name("foo/bar/") == "foo/bar"); + CHECK(EN::normal_module_name("./foo/bar") == "foo/bar"); + CHECK(EN::normal_module_name("/foo/bar") == "foo/bar"); + CHECK(EN::normal_module_name("/foo/bar/.") == "foo/bar"); + CHECK(EN::normal_module_name("/foo/bar/baz/..") == "foo/bar"); + CHECK(EN::normal_module_name("foo/baz/../bar") == "foo/bar"); + CHECK(EN::normal_module_name("../../../foo/bar") == "foo/bar"); + + CHECK(EN::normal_module_name("").empty()); + CHECK(EN::normal_module_name(".").empty()); + CHECK(EN::normal_module_name("./").empty()); + CHECK(EN::normal_module_name("./.").empty()); + CHECK(EN::normal_module_name("/").empty()); + CHECK(EN::normal_module_name("/.").empty()); + CHECK(EN::normal_module_name("..").empty()); +} |