working with address impl

This commit is contained in:
2019-03-29 17:50:48 +07:00
parent f1f0ce328e
commit 344aec46ba
3 changed files with 50 additions and 0 deletions

View File

@@ -8,4 +8,24 @@
using namespace e2d;
TEST_CASE("address") {
SECTION("parent") {
REQUIRE(address::parent("") == "");
REQUIRE(address::parent(":/") == "");
REQUIRE(address::parent(":/child") == "");
REQUIRE(address::parent("at/las.json") == "at/las.json");
REQUIRE(address::parent("at/las.json:/") == "at/las.json");
REQUIRE(address::parent("at/las.json:/spr/ite.png") == "at/las.json");
REQUIRE(address::parent("at/las.json:/spr/ite.png:/") == "at/las.json");
REQUIRE(address::parent("at/las.json:/spr/ite.png:/child") == "at/las.json");
}
SECTION("nested") {
REQUIRE(address::nested("") == "");
REQUIRE(address::nested(":/") == "");
REQUIRE(address::nested(":/chi/ld") == "chi/ld");
REQUIRE(address::nested("at/las.json") == "");
REQUIRE(address::nested("at/las.json:/") == "");
REQUIRE(address::nested("at/las.json:/spr/ite.png") == "spr/ite.png");
REQUIRE(address::nested("at/las.json:/spr/ite.png:/") == "spr/ite.png:/");
REQUIRE(address::nested("at/las.json:/spr/ite.png:/chi/ld") == "spr/ite.png:/chi/ld");
}
}