mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 09:08:08 +08:00
test: add test cases with quotes in ml-string
some of these example strings are copied from toml-lang/toml:README.md and some are modified.
This commit is contained in:
@@ -57,6 +57,22 @@ BOOST_AUTO_TEST_CASE(test_ml_basic_string)
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"\"\"\"\\\n The quick brown \\\n\n fox jumps over \\\n the lazy dog.\\\n \"\"\"",
|
||||
"\"\"\"\\\n The quick brown \\\n\n fox jumps over \\\n the lazy dog.\\\n \"\"\"");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"\"\"\"Here are two quotation marks: \"\". Simple enough.\"\"\"",
|
||||
"\"\"\"Here are two quotation marks: \"\". Simple enough.\"\"\"");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"\"\"\"Here are three quotation marks: \"\"\\\".\"\"\"",
|
||||
"\"\"\"Here are three quotation marks: \"\"\\\".\"\"\"");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"\"\"\"Here are fifteen quotation marks: \"\"\\\"\"\"\\\"\"\"\\\"\"\"\\\"\"\"\\\".\"\"\"",
|
||||
"\"\"\"Here are fifteen quotation marks: \"\"\\\"\"\"\\\"\"\"\\\"\"\"\\\"\"\"\\\".\"\"\"");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"\"\"\"\"This,\" she said, \"is just a pointless statement.\"\"\"\"",
|
||||
"\"\"\"\"This,\" she said, \"is just a pointless statement.\"\"\"\"");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_literal_string)
|
||||
@@ -83,4 +99,16 @@ BOOST_AUTO_TEST_CASE(test_ml_literal_string)
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"'''\nThe first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n'''",
|
||||
"'''\nThe first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n'''");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"''''That's still pointless', she said.'''",
|
||||
"''''That's still pointless', she said.'''");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"'''Here are fifteen quotation marks: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\".'''",
|
||||
"'''Here are fifteen quotation marks: \"\"\"\"\"\"\"\"\"\"\"\"\"\"\".'''");
|
||||
|
||||
TOML11_TEST_LEX_ACCEPT(lex_string,
|
||||
"''''This,' she said, 'is just a pointless statement.''''",
|
||||
"''''This,' she said, 'is just a pointless statement.''''");
|
||||
}
|
||||
|
Reference in New Issue
Block a user