more FileReader tests

This commit is contained in:
Josh Holtrop 2014-06-05 20:07:23 -04:00
parent 1d10771048
commit f360077f04
2 changed files with 13 additions and 0 deletions

0
test/files/empty.txt Normal file
View File

View File

@ -9,6 +9,19 @@ TEST(FileReaderTest, num_lines_defaults_to_0)
EXPECT_EQ(0, fr.num_lines()); EXPECT_EQ(0, fr.num_lines());
} }
TEST(FileReaderTest, load_returns_false_for_nonexistent_file)
{
FileReader fr;
EXPECT_FALSE(fr.load("this/file/does/not/exist.txt"));
}
TEST(FileReaderTest, loading_empty_file)
{
FileReader fr;
EXPECT_TRUE(fr.load("test/files/empty.txt"));
EXPECT_EQ(0, fr.num_lines());
}
TEST(FileReaderTest, reads_lf_format_file) TEST(FileReaderTest, reads_lf_format_file)
{ {
FileReader fr; FileReader fr;