diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-01-05 00:49:41 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-01-05 00:49:41 (GMT) |
commit | 83a50c341e016c3c5cf74a95775ae50e4f12d2ae (patch) | |
tree | fc1437a6e3ce959ee122f4d8f3a496a0c4ca3752 /src/build_log_test.cc | |
parent | d56c101948bd69fdc9e7541eb6ac38ebc0e6c8bf (diff) | |
download | Ninja-83a50c341e016c3c5cf74a95775ae50e4f12d2ae.zip Ninja-83a50c341e016c3c5cf74a95775ae50e4f12d2ae.tar.gz Ninja-83a50c341e016c3c5cf74a95775ae50e4f12d2ae.tar.bz2 |
Switch build log to use tabs as field separators, to support outputs with spaces.
Diffstat (limited to 'src/build_log_test.cc')
-rw-r--r-- | src/build_log_test.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/build_log_test.cc b/src/build_log_test.cc index cf31c1d..f8c8ec3 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -134,3 +134,22 @@ TEST_F(BuildLogTest, UpgradeV2) { ASSERT_EQ(0, e->restat_mtime); ASSERT_EQ("command", e->command); } + +TEST_F(BuildLogTest, SpacesInOutputV4) { + FILE* f = fopen(kTestFilename, "wb"); + fprintf(f, "# ninja log v4\n"); + fprintf(f, "123\t456\t456\tout with space\tcommand\n"); + fclose(f); + + string err; + BuildLog log; + EXPECT_TRUE(log.Load(kTestFilename, &err)); + ASSERT_EQ("", err); + + BuildLog::LogEntry* e = log.LookupByOutput("out with space"); + ASSERT_TRUE(e); + ASSERT_EQ(123, e->start_time); + ASSERT_EQ(456, e->end_time); + ASSERT_EQ(456, e->restat_mtime); + ASSERT_EQ("command", e->command); +} |