mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 12:38:38 -10:00
This is not required by POSIX, and ENOENT seems more natural here. This fixes a libcxx test.
17 lines
329 B
C++
17 lines
329 B
C++
/*
|
|
* Copyright (c) 2026, Lucas Chollet <[email protected]>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/ByteString.h>
|
|
#include <LibTest/TestCase.h>
|
|
#include <unistd.h>
|
|
|
|
TEST_CASE(truncate_no_file)
|
|
{
|
|
int rc = truncate("/tmp/i_do_not_exist", 42);
|
|
EXPECT(rc < 0);
|
|
EXPECT(errno == ENOENT);
|
|
}
|