Index: tools/gn/path_output_unittest.cc |
diff --git a/tools/gn/path_output_unittest.cc b/tools/gn/path_output_unittest.cc |
index 389f96a40451db4b87f88c3ebdb4f84cbf071161..217f6dcfc3b30409dcd59bd289c0a25f98ce5d1c 100644 |
--- a/tools/gn/path_output_unittest.cc |
+++ b/tools/gn/path_output_unittest.cc |
@@ -5,6 +5,7 @@ |
#include <sstream> |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "tools/gn/output_file.h" |
#include "tools/gn/path_output.h" |
#include "tools/gn/source_dir.h" |
#include "tools/gn/source_file.h" |
@@ -213,8 +214,6 @@ TEST(PathOutput, WriteDir) { |
// Output inside current dir. |
{ |
std::ostringstream out; |
- |
- |
writer.WriteDir(out, SourceDir("//out/Debug/"), |
PathOutput::DIR_INCLUDE_LAST_SLASH); |
EXPECT_EQ("./", out.str()); |
@@ -237,6 +236,26 @@ TEST(PathOutput, WriteDir) { |
PathOutput::DIR_NO_LAST_SLASH); |
EXPECT_EQ("foo", out.str()); |
} |
+ |
+ // WriteDir using an OutputFile. |
+ { |
+ std::ostringstream out; |
+ writer.WriteDir(out, OutputFile("foo/"), |
+ PathOutput::DIR_INCLUDE_LAST_SLASH); |
+ EXPECT_EQ("foo/", out.str()); |
+ } |
+ { |
+ std::ostringstream out; |
+ writer.WriteDir(out, OutputFile("foo/"), |
+ PathOutput::DIR_NO_LAST_SLASH); |
+ EXPECT_EQ("foo", out.str()); |
+ } |
+ { |
+ std::ostringstream out; |
+ writer.WriteDir(out, OutputFile(), |
+ PathOutput::DIR_INCLUDE_LAST_SLASH); |
+ EXPECT_EQ("", out.str()); |
+ } |
} |
{ |
// Empty build dir writer. |