Skip to content

Commit

Permalink
Fix tests for gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
bugdea1er committed Jan 27, 2024
1 parent 55eb145 commit 4b0e824
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/file_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ TEST(FileTest, Write) {
const auto tmpfile = tmp::file();
tmpfile.write("Hello");

std::ifstream stream(tmpfile);
std::string content(std::istreambuf_iterator<char>(stream), {});
auto stream = std::ifstream(fs::path(tmpfile));
auto content = std::string(std::istreambuf_iterator<char>(stream), {});
ASSERT_EQ(content, "Hello");
}

Expand All @@ -76,7 +76,7 @@ TEST(FileTest, Append) {
tmpfile.write("Hello");
tmpfile.append(", world!");

std::ifstream stream(tmpfile);
std::string content(std::istreambuf_iterator<char>(stream), {});
auto stream = std::ifstream(fs::path(tmpfile));
auto content = std::string(std::istreambuf_iterator<char>(stream), {});
ASSERT_EQ(content, "Hello, world!");
}

0 comments on commit 4b0e824

Please sign in to comment.