Index: tools/gn/args_unittest.cc |
diff --git a/tools/gn/args_unittest.cc b/tools/gn/args_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7a1959d697f74eabd421ee9176bac863f9e5c3dd |
--- /dev/null |
+++ b/tools/gn/args_unittest.cc |
@@ -0,0 +1,27 @@ |
+// 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 "tools/gn/args.h" |
+ |
+#include "testing/gtest/include/gtest/gtest.h" |
+#include "tools/gn/scheduler.h" |
+#include "tools/gn/test_with_scope.h" |
+ |
+TEST(ArgsTest, DeclareArgsMultipleTimes) { |
+ TestWithScope setup1, setup2; |
+ Args args; |
+ Scope::KeyValueMap key_value_map1; |
+ Err err; |
+ LiteralNode assignment1; |
+ |
+ setup1.scope()->SetValue("a", Value(nullptr, true), &assignment1); |
+ setup1.scope()->GetCurrentScopeValues(&key_value_map1); |
+ EXPECT_TRUE(args.DeclareArgs(key_value_map1, setup1.scope(), &err)); |
+ |
+ LiteralNode assignment2; |
+ setup2.scope()->SetValue("a", Value(nullptr, true), &assignment2); |
+ Scope::KeyValueMap key_value_map2; |
+ setup2.scope()->GetCurrentScopeValues(&key_value_map2); |
+ EXPECT_TRUE(args.DeclareArgs(key_value_map2, setup2.scope(), &err)); |
+} |