Skip to content

Commit af33ca2

Browse files
committed
Fixed unit tests for directory separator suffix
1 parent 238e002 commit af33ca2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

tests/unit/glob_lib_test.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static void test_glob_find(void)
271271
{
272272
Seq *const matches = GlobFind(".");
273273
assert_int_equal(SeqLength(matches), 1);
274-
assert_string_equal(SeqAt(matches, 0), ".");
274+
assert_string_equal(SeqAt(matches, 0), "." FILE_SEPARATOR_STR);
275275
SeqDestroy(matches);
276276
}
277277
}
@@ -289,10 +289,10 @@ static void test_glob_file_list(void)
289289
// Create test subdirectories.
290290

291291
static const char *const test_subdirs[] = {
292-
"foo",
293-
"foo" FILE_SEPARATOR_STR "bar",
294-
"foo" FILE_SEPARATOR_STR "bar" FILE_SEPARATOR_STR "baz",
295-
"qux",
292+
"foo" FILE_SEPARATOR_STR,
293+
"foo" FILE_SEPARATOR_STR "bar" FILE_SEPARATOR_STR,
294+
"foo" FILE_SEPARATOR_STR "bar" FILE_SEPARATOR_STR "baz" FILE_SEPARATOR_STR,
295+
"qux" FILE_SEPARATOR_STR,
296296
};
297297
const size_t num_test_subdirs =
298298
sizeof(test_subdirs) / sizeof(const char *);
@@ -471,14 +471,14 @@ static void test_glob_file_list(void)
471471
matches = GlobFileList(pattern);
472472
assert_int_equal(StringSetSize(matches), 4);
473473

474-
ret = snprintf(path, PATH_MAX, "%s" FILE_SEPARATOR_STR "foo", test_dir);
474+
ret = snprintf(path, PATH_MAX, "%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR, test_dir);
475475
assert_true(ret < PATH_MAX && ret >= 0);
476476
assert_true(StringSetContains(matches, path));
477477

478478
ret = snprintf(
479479
path,
480480
PATH_MAX,
481-
"%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR "bar",
481+
"%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR "bar" FILE_SEPARATOR_STR,
482482
test_dir);
483483
assert_true(ret < PATH_MAX && ret >= 0);
484484
assert_true(StringSetContains(matches, path));
@@ -487,12 +487,12 @@ static void test_glob_file_list(void)
487487
path,
488488
PATH_MAX,
489489
"%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR
490-
"bar" FILE_SEPARATOR_STR "baz",
490+
"bar" FILE_SEPARATOR_STR "baz" FILE_SEPARATOR_STR,
491491
test_dir);
492492
assert_true(ret < PATH_MAX && ret >= 0);
493493
assert_true(StringSetContains(matches, path));
494494

495-
ret = snprintf(path, PATH_MAX, "%s" FILE_SEPARATOR_STR "qux", test_dir);
495+
ret = snprintf(path, PATH_MAX, "%s" FILE_SEPARATOR_STR "qux" FILE_SEPARATOR_STR, test_dir);
496496
assert_true(ret < PATH_MAX && ret >= 0);
497497
assert_true(StringSetContains(matches, path));
498498

@@ -676,14 +676,14 @@ static void test_glob_file_list(void)
676676

677677
assert_int_equal(StringSetSize(matches), 2);
678678

679-
ret = snprintf(path, PATH_MAX, "%s" FILE_SEPARATOR_STR "foo", test_dir);
679+
ret = snprintf(path, PATH_MAX, "%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR, test_dir);
680680
assert_true(ret < PATH_MAX && ret >= 0);
681681
assert_true(StringSetContains(matches, path));
682682

683683
ret = snprintf(
684684
path,
685685
PATH_MAX,
686-
"%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR "bar",
686+
"%s" FILE_SEPARATOR_STR "foo" FILE_SEPARATOR_STR "bar" FILE_SEPARATOR_STR,
687687
test_dir);
688688
assert_true(ret < PATH_MAX && ret >= 0);
689689
assert_true(StringSetContains(matches, path));

0 commit comments

Comments
 (0)