aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/command_line_interface_unittest.cc
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-04-28 00:49:36 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-04-28 00:49:36 +0000
commitef3730c2df51aa227250cf4f28fd1e4839916877 (patch)
treed36694a59347189b21e8486fc41ef56876e71e6b /src/google/protobuf/compiler/command_line_interface_unittest.cc
parentd33e53ad4c4f75a65cc806f26d8b86582e82a2e8 (diff)
downloadprotobuf-ef3730c2df51aa227250cf4f28fd1e4839916877.tar.gz
protobuf-ef3730c2df51aa227250cf4f28fd1e4839916877.tar.bz2
protobuf-ef3730c2df51aa227250cf4f28fd1e4839916877.zip
Add test verifying that protoc accepts trailing backslashes on Windows, which some users claim doesn't work. Seems to work on my machine.
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/command_line_interface_unittest.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
index af765b87..719771eb 100644
--- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
@@ -539,6 +539,24 @@ TEST_F(CommandLineInterfaceTest, WindowsOutputPathAndParameter) {
EXPECT_EQ("bar", generator->parameter_);
}
+TEST_F(CommandLineInterfaceTest, TrailingBackslash) {
+ // Test that the directories can end in backslashes. Some users claim this
+ // doesn't work on their system.
+
+ RegisterGenerator("test_generator", "--test_out",
+ "output.test", "Test output.");
+
+ CreateTempFile("foo.proto",
+ "syntax = \"proto2\";\n"
+ "message Foo {}\n");
+
+ Run("protocol_compiler --test_out=$tmpdir\\ "
+ "--proto_path=$tmpdir\\ foo.proto");
+
+ ExpectNoErrors();
+ ExpectGenerated("test_generator", "", "foo.proto", "Foo", "output.test");
+}
+
#endif // defined(_WIN32) || defined(__CYGWIN__)
TEST_F(CommandLineInterfaceTest, PathLookup) {