BLI_string: support escaping additional control character

Add support for escaping \a, \b & \f for completeness,
currently it's not required.
This commit is contained in:
2020-12-10 13:45:57 +11:00
parent 15d801625c
commit 82e1b65d91
2 changed files with 15 additions and 5 deletions

View File

@@ -863,11 +863,14 @@ TEST_F(StringEscape, Control)
{"\n", "\\n"},
{"\r", "\\r"},
{"\t", "\\t"},
{"\a", "\\a"},
{"\b", "\\b"},
{"\f", "\\f"},
{"A\n", "A\\n"},
{"\nA", "\\nA"},
{"\n\r\t", "\\n\\r\\t"},
{"\n_\r_\t", "\\n_\\r_\\t"},
{"\n\\\r\\\t", "\\n\\\\\\r\\\\\\t"},
{"\n\r\t\a\b\f", "\\n\\r\\t\\a\\b\\f"},
{"\n_\r_\t_\a_\b_\f", "\\n_\\r_\\t_\\a_\\b_\\f"},
{"\n\\\r\\\t\\\a\\\b\\\f", "\\n\\\\\\r\\\\\\t\\\\\\a\\\\\\b\\\\\\f"},
};
testEscapeWords(escaped);