name: Make sure empty name component (...) is not skipped during URI decoding
Change-Id: I85f96711b335573156c2c00722847d187ecf194c
Refs: #2725
diff --git a/tests/unit-tests/name.t.cpp b/tests/unit-tests/name.t.cpp
index 6271c7a..7576b61 100644
--- a/tests/unit-tests/name.t.cpp
+++ b/tests/unit-tests/name.t.cpp
@@ -165,6 +165,7 @@
Name name2;
BOOST_REQUIRE_NO_THROW(name2 = std::move(Name(nameUri)));
+ BOOST_CHECK_EQUAL(name2.toUri(), nameUri);
Block name2Encoded = name2.wireEncode();
BOOST_CHECK(name2Encoded == nameBlock);
}
@@ -493,6 +494,15 @@
}
}
+BOOST_AUTO_TEST_CASE(NameWithSpaces)
+{
+ Name name("/ hello\t/\tworld \r\n");
+
+ BOOST_CHECK_EQUAL("/hello/world", name);
+ BOOST_CHECK_THROW(Name("/hello//world"), name::Component::Error);
+}
+
+
BOOST_AUTO_TEST_SUITE_END()
} // namespace tests