test-chase: Add one more test for chase_and_openat()

This commit is contained in:
Daan De Meyer 2023-06-02 11:05:10 +02:00
parent 3c8f449cc8
commit 8b85333cda

View file

@ -586,6 +586,12 @@ TEST(chaseat) {
assert_se(fd_verify_directory(fd) >= 0);
fd = safe_close(fd);
fd = chase_and_openat(tfd, NULL, CHASE_PARENT|CHASE_EXTRACT_FILENAME, O_PATH|O_DIRECTORY|O_CLOEXEC, &result);
assert_se(fd >= 0);
assert_se(streq(result, "."));
fd = safe_close(fd);
result = mfree(result);
/* Test chase_and_openatdir() */
assert_se(chase_and_opendirat(tfd, "o/p/e/n/d/i", 0, &result, &dir) >= 0);