mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 02:36:19 +01:00
tests: Separate invalid escaping tests for GKeyFile
One test key was serving two purposes, which meant tests for it couldn’t be separated out. It was testing escape-at-end-of-line and also invalid-escape. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #3098
This commit is contained in:
parent
76d77cf623
commit
ef28253e57
@ -589,8 +589,9 @@ test_string (void)
|
||||
"key6=trailing space \n"
|
||||
"[invalid]\n"
|
||||
"key1=\\a\\b\\0800xff\n"
|
||||
"key2=blabla\\\n"
|
||||
"key3=foo\\i\\\n";
|
||||
"key2=blabla\\\n" /* escape at end of line */
|
||||
"key3=\\ifoo\n" /* invalid escape */
|
||||
"key4=\\i\\hfoo\n"; /* invalid escape with multiple stacked errors */
|
||||
|
||||
keyfile = load_data (data, 0);
|
||||
|
||||
@ -613,6 +614,10 @@ test_string (void)
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
g_free (value);
|
||||
|
||||
value = g_key_file_get_string (keyfile, "invalid", "key4", &error);
|
||||
check_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE);
|
||||
g_free (value);
|
||||
|
||||
g_key_file_set_string (keyfile, "inserted", "key1", "simple");
|
||||
g_key_file_set_string (keyfile, "inserted", "key2", " leading space");
|
||||
g_key_file_set_string (keyfile, "inserted", "key3", "\tleading tab");
|
||||
|
Loading…
Reference in New Issue
Block a user