testsuite: Windows separators are different

On top of that we defined a preprocessor constant to 2 different
values, but instead of checking the value, we only checked if
it was defined. Now we only define it in one place.
This commit is contained in:
Benjamin Otte
2024-10-20 07:00:42 +02:00
parent 3694aed022
commit 01c754f93b

View File

@@ -1,9 +1,7 @@
#include <gtk/gtk.h>
#include "gtk/gtkprivate.h"
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
#define DO_ESCAPE 0
#else
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
#define DO_ESCAPE 1
#endif
@@ -25,17 +23,17 @@ static TestCase tests[] = {
{ "?", "a", TRUE, FALSE, TRUE },
{ "?", ".", TRUE, FALSE, FALSE },
{ "a?", "a.", TRUE, FALSE, TRUE },
{ "a/?", "a/b", TRUE, FALSE, TRUE },
{ "a/?", "a/.", TRUE, FALSE, FALSE },
{ "?", "/", TRUE, FALSE, FALSE },
{ "a" G_DIR_SEPARATOR_S "?", "a" G_DIR_SEPARATOR_S "b", TRUE, FALSE, TRUE },
{ "a" G_DIR_SEPARATOR_S "?", "a" G_DIR_SEPARATOR_S ".", TRUE, FALSE, FALSE },
{ "?", "" G_DIR_SEPARATOR_S "", TRUE, FALSE, FALSE },
/* Test what * matches */
{ "*", "a", TRUE, FALSE, TRUE },
{ "*", ".", TRUE, FALSE, FALSE },
{ "a*", "a.", TRUE, FALSE, TRUE },
{ "a/*", "a/b", TRUE, FALSE, TRUE },
{ "a/*", "a/.", TRUE, FALSE, FALSE },
{ "*", "/", TRUE, FALSE, FALSE },
{ "a" G_DIR_SEPARATOR_S "*", "a" G_DIR_SEPARATOR_S "b", TRUE, FALSE, TRUE },
{ "a" G_DIR_SEPARATOR_S "*", "a" G_DIR_SEPARATOR_S ".", TRUE, FALSE, FALSE },
{ "*", "" G_DIR_SEPARATOR_S "", TRUE, FALSE, FALSE },
/* Range tests */
{ "[ab]", "a", TRUE, FALSE, TRUE },
@@ -61,9 +59,9 @@ static TestCase tests[] = {
/* Ranges and special no-wildcard matches */
{ "[.]", ".", TRUE, FALSE, FALSE },
{ "a[.]", "a.", TRUE, FALSE, TRUE },
{ "a/[.]", "a/.", TRUE, FALSE, FALSE },
{ "[/]", "/", TRUE, FALSE, FALSE },
{ "[^/]", "a", TRUE, FALSE, TRUE },
{ "a" G_DIR_SEPARATOR_S "[.]", "a" G_DIR_SEPARATOR_S ".", TRUE, FALSE, FALSE },
{ "[" G_DIR_SEPARATOR_S "]", "" G_DIR_SEPARATOR_S "", TRUE, FALSE, FALSE },
{ "[^" G_DIR_SEPARATOR_S "]", "a", TRUE, FALSE, TRUE },
/* Basic tests of * (and combinations of * and ?) */
{ "a*b", "ab", TRUE, FALSE, TRUE },
@@ -81,8 +79,8 @@ static TestCase tests[] = {
{ "a*[cd]", "axc", TRUE, FALSE, TRUE },
{ "a*[cd]", "axx", TRUE, FALSE, FALSE },
{ "a/[.]", "a/.", TRUE, FALSE, FALSE },
{ "a*[.]", "a/.", TRUE, FALSE, FALSE },
{ "a" G_DIR_SEPARATOR_S "[.]", "a" G_DIR_SEPARATOR_S ".", TRUE, FALSE, FALSE },
{ "a*[.]", "a" G_DIR_SEPARATOR_S ".", TRUE, FALSE, FALSE },
/* Test of UTF-8 */