mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-27 15:35:18 +00:00
Fix test when the output file exists.
This commit is contained in:
parent
e3063a5902
commit
11b3b5128e
@ -50,6 +50,7 @@
|
||||
# include <io.h>
|
||||
# define O_WRONLY _O_WRONLY
|
||||
# define O_CREAT _O_CREAT
|
||||
# define O_TRUNC _O_TRUNC
|
||||
# define S_IRUSR _S_IREAD
|
||||
# define S_IWUSR _S_IWRITE
|
||||
# define open _open
|
||||
@ -1658,7 +1659,7 @@ TEST(FormatTest, PrintColored) {
|
||||
File saved_stdio(dup(1));
|
||||
EXPECT_NE(-1, saved_stdio.fd());
|
||||
{
|
||||
File out(open("out", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR));
|
||||
File out(open("out", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR));
|
||||
EXPECT_NE(-1, out.fd());
|
||||
EXPECT_NE(-1, dup2(out.fd(), 1));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user