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

Unified Diff: tools/gn/function_forward_variables_from_unittest.cc

Issue 2219083002: Update GN toolchain_args to be a variable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge remote-tracking branch 'origin/master' into toolchain_args Created 4 years, 4 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/function_forward_variables_from.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_forward_variables_from_unittest.cc
diff --git a/tools/gn/function_forward_variables_from_unittest.cc b/tools/gn/function_forward_variables_from_unittest.cc
index 2e6f5a2800ccf377019ffa6ca47daff9e65dbb16..84d8b6eaf7acb23635a57c5ffad19f3c93506740 100644
--- a/tools/gn/function_forward_variables_from_unittest.cc
+++ b/tools/gn/function_forward_variables_from_unittest.cc
@@ -50,6 +50,28 @@ TEST(FunctionForwardVariablesFrom, List) {
}
}
+TEST(FunctionForwardVariablesFrom, LiteralList) {
+ Scheduler scheduler;
+ TestWithScope setup;
+
+ // Forwards all variables from a literal scope into another scope definition.
+ TestParseInput input(
+ "a = {\n"
+ " forward_variables_from({x = 1 y = 2}, \"*\")\n"
+ " z = 3\n"
+ "}\n"
+ "print(\"${a.x} ${a.y} ${a.z}\")\n");
+
+ ASSERT_FALSE(input.has_error());
+
+ Err err;
+ input.parsed()->Execute(setup.scope(), &err);
+ ASSERT_FALSE(err.has_error()) << err.message();
+
+ EXPECT_EQ("1 2 3\n", setup.print_output());
+ setup.print_output().clear();
+}
+
TEST(FunctionForwardVariablesFrom, ListWithExclusion) {
Scheduler scheduler;
TestWithScope setup;
@@ -94,7 +116,7 @@ TEST(FunctionForwardVariablesFrom, ErrorCases) {
Err err;
invalid_source.parsed()->Execute(setup.scope(), &err);
EXPECT_TRUE(err.has_error());
- EXPECT_EQ("Expected an identifier for the scope.", err.message());
+ EXPECT_EQ("This is not a scope.", err.message());
// Type check the list. We need to use a new template name each time since
// all of these invocations are executing in sequence in the same scope.
« no previous file with comments | « tools/gn/function_forward_variables_from.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698