diff options
Diffstat (limited to 'libc/test/src/string/strsep_test.cpp')
| -rw-r--r-- | libc/test/src/string/strsep_test.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/test/src/string/strsep_test.cpp b/libc/test/src/string/strsep_test.cpp index e2a5d52bbedd..553edd99604e 100644 --- a/libc/test/src/string/strsep_test.cpp +++ b/libc/test/src/string/strsep_test.cpp @@ -61,6 +61,14 @@ TEST(LlvmLibcStrsepTest, SubsequentSearchesReturnNull) { ASSERT_EQ(LIBC_NAMESPACE::strsep(&string, ":"), nullptr); } +TEST(LlvmLibcStrsepTest, TopBitSet) { + char top_bit_set_str[] = "hello\x80world"; + char *p = top_bit_set_str; + ASSERT_STREQ(LIBC_NAMESPACE::strsep(&p, "\x80"), "hello"); + ASSERT_STREQ(LIBC_NAMESPACE::strsep(&p, "\x80"), "world"); + ASSERT_EQ(LIBC_NAMESPACE::strsep(&p, "\x80"), nullptr); +} + #if defined(LIBC_ADD_NULL_CHECKS) TEST(LlvmLibcStrsepTest, CrashOnNullPtr) { |
