summaryrefslogtreecommitdiff
path: root/src/io/read_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/read_test.cpp')
-rw-r--r--src/io/read_test.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/io/read_test.cpp b/src/io/read_test.cpp
index 87f95ba..8fe84b7 100644
--- a/src/io/read_test.cpp
+++ b/src/io/read_test.cpp
@@ -20,10 +20,15 @@
#include <gtest/gtest.h>
+#include "../strings/astring.hpp"
#include "../strings/zstring.hpp"
+#include "../strings/literal.hpp"
#include "../poison.hpp"
+
+namespace tmwa
+{
static
io::FD string_pipe(ZString sz)
{
@@ -42,43 +47,44 @@ io::FD string_pipe(ZString sz)
TEST(io, read1)
{
- io::ReadFile rf(string_pipe("Hello"));
+ io::ReadFile rf(string_pipe("Hello"_s));
AString hi;
EXPECT_TRUE(rf.getline(hi));
- EXPECT_EQ(hi, "Hello");
+ EXPECT_EQ(hi, "Hello"_s);
EXPECT_FALSE(rf.getline(hi));
}
TEST(io, read2)
{
- io::ReadFile rf(string_pipe("Hello\n"));
+ io::ReadFile rf(string_pipe("Hello\n"_s));
AString hi;
EXPECT_TRUE(rf.getline(hi));
- EXPECT_EQ(hi, "Hello");
+ EXPECT_EQ(hi, "Hello"_s);
EXPECT_FALSE(rf.getline(hi));
}
TEST(io, read3)
{
- io::ReadFile rf(string_pipe("Hello\r"));
+ io::ReadFile rf(string_pipe("Hello\r"_s));
AString hi;
EXPECT_TRUE(rf.getline(hi));
- EXPECT_EQ(hi, "Hello");
+ EXPECT_EQ(hi, "Hello"_s);
EXPECT_FALSE(rf.getline(hi));
}
TEST(io, read4)
{
- io::ReadFile rf(string_pipe("Hello\r\n"));
+ io::ReadFile rf(string_pipe("Hello\r\n"_s));
AString hi;
EXPECT_TRUE(rf.getline(hi));
- EXPECT_EQ(hi, "Hello");
+ EXPECT_EQ(hi, "Hello"_s);
EXPECT_FALSE(rf.getline(hi));
}
TEST(io, read5)
{
- io::ReadFile rf(string_pipe("Hello\n\r"));
+ io::ReadFile rf(string_pipe("Hello\n\r"_s));
AString hi;
EXPECT_TRUE(rf.getline(hi));
- EXPECT_EQ(hi, "Hello");
+ EXPECT_EQ(hi, "Hello"_s);
EXPECT_TRUE(rf.getline(hi));
EXPECT_FALSE(hi);
EXPECT_FALSE(rf.getline(hi));
}
+} // namespace tmwa