| 12 | using generative::io::from_wkt; |
| 13 | |
| 14 | TEST(TGFGraphReaderTests, IstreamSanity) |
| 15 | { |
| 16 | std::istringstream input{"asdf 3.14\n"}; |
| 17 | |
| 18 | double pi = 0; |
| 19 | input >> pi; |
| 20 | |
| 21 | EXPECT_TRUE(input.fail()); |
| 22 | EXPECT_EQ(pi, 0); |
| 23 | |
| 24 | // CLear the failure flags. |
| 25 | input.clear(); |
| 26 | |
| 27 | std::string misc; |
| 28 | input >> misc; |
| 29 | EXPECT_FALSE(input.fail()); |
| 30 | EXPECT_EQ(misc, "asdf"); |
| 31 | |
| 32 | input >> pi; |
| 33 | EXPECT_FALSE(input.fail()); |
| 34 | EXPECT_EQ(pi, 3.14); |
| 35 | } |
| 36 | |
| 37 | TEST(TGFGraphReaderTests, IstreamReadRestofLineWithWhitespace) |
| 38 | { |
nothing calls this directly
no test coverage detected