Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: tools/gn/source_file_unittest.cc

Issue 1214933007: Normalize paths in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually "git add" the test file. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/source_file.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/source_file_unittest.cc
diff --git a/tools/gn/source_file_unittest.cc b/tools/gn/source_file_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8a9218f5d282ebf96b01c36322d28b17bca68c74
--- /dev/null
+++ b/tools/gn/source_file_unittest.cc
@@ -0,0 +1,19 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "testing/gtest/include/gtest/gtest.h"
+#include "tools/gn/source_file.h"
+
+// The SourceFile object should normalize the input passed to the constructor.
+// The normalizer unit test checks for all the weird edge cases for normalizing
+// so here just check that it gets called.
+TEST(SourceFile, Normalize) {
+ SourceFile a("//foo/../bar.cc");
+ EXPECT_EQ("//bar.cc", a.value());
+
+ std::string b_str("//foo/././../bar.cc");
+ SourceFile b(SourceFile::SwapIn(), &b_str);
+ EXPECT_TRUE(b_str.empty()); // Should have been swapped in.
+ EXPECT_EQ("//bar.cc", b.value());
+}
« no previous file with comments | « tools/gn/source_file.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698