Fixed string_view::ensure_z() for const char*.

This commit is contained in:
Matt Newport
2015-10-26 18:23:14 -07:00
parent ecc2ee5f1e
commit 0cbdc7036d
2 changed files with 11 additions and 3 deletions
+8
View File
@@ -79,6 +79,14 @@ SUITE(string_view_tests)
}
}
TEST(TestConstructFromConstCharPointer)
{
const char* s = "Hello";
cstring_view<> v = ensure_z(s);
CHECK(v.length() == 5);
CHECK(v.used_length() == v.length());
}
TEST(TestConversionToConst)
{
char stack_string[] = "Hello";