OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "tools/gn/args.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "tools/gn/scheduler.h" |
| 9 #include "tools/gn/test_with_scope.h" |
| 10 |
| 11 TEST(ArgsTest, DeclareArgsMultipleTimes) { |
| 12 TestWithScope setup1, setup2; |
| 13 Args args; |
| 14 Scope::KeyValueMap key_value_map1; |
| 15 Err err; |
| 16 LiteralNode assignment1; |
| 17 |
| 18 setup1.scope()->SetValue("a", Value(nullptr, true), &assignment1); |
| 19 setup1.scope()->GetCurrentScopeValues(&key_value_map1); |
| 20 EXPECT_TRUE(args.DeclareArgs(key_value_map1, setup1.scope(), &err)); |
| 21 |
| 22 LiteralNode assignment2; |
| 23 setup2.scope()->SetValue("a", Value(nullptr, true), &assignment2); |
| 24 Scope::KeyValueMap key_value_map2; |
| 25 setup2.scope()->GetCurrentScopeValues(&key_value_map2); |
| 26 EXPECT_TRUE(args.DeclareArgs(key_value_map2, setup2.scope(), &err)); |
| 27 } |
OLD | NEW |