Skip to content

Commit 04f96a9

Browse files
committed
Add additional Python compatibility edge case tests
1 parent 1d0dc42 commit 04f96a9

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

test.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,5 +1281,20 @@ PYSTRING_ADD_TEST(python3_compat, splitlines)
12811281
std::vector<std::string> _e43 = {"\n", "hello"};
12821282
PYSTRING_CHECK_ASSERT((pystring_splitlines("\nhello", true)) == _e43);
12831283
}
1284+
{
1285+
std::vector<std::string> _e44 = {"hello", "", "world"};
1286+
PYSTRING_CHECK_ASSERT((pystring_splitlines("hello\n\nworld", false)) == _e44);
1287+
}
1288+
{
1289+
std::vector<std::string> _e45 = {"hello\n", "\n", "world"};
1290+
PYSTRING_CHECK_ASSERT((pystring_splitlines("hello\n\nworld", true)) == _e45);
1291+
}
1292+
{
1293+
std::vector<std::string> _e46 = {"hello", ""};
1294+
PYSTRING_CHECK_ASSERT((pystring_splitlines("hello\n\n", false)) == _e46);
1295+
}
1296+
{
1297+
std::vector<std::string> _e47 = {"hello\n", "\n"};
1298+
PYSTRING_CHECK_ASSERT((pystring_splitlines("hello\n\n", true)) == _e47);
1299+
}
12841300
}
1285-

0 commit comments

Comments
 (0)