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

Unified Diff: tools/gn/functions_unittest.cc

Issue 2586073002: Revert GN declare_args() change. (Closed)
Patch Set: Created 4 years 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/functions.cc ('k') | tools/gn/parse_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/functions_unittest.cc
diff --git a/tools/gn/functions_unittest.cc b/tools/gn/functions_unittest.cc
index 949b844b34bc3a9b2ad5eafdd6653ad3802ccb35..7156747471225952ae48d78b3b5f4ca8e509449b 100644
--- a/tools/gn/functions_unittest.cc
+++ b/tools/gn/functions_unittest.cc
@@ -125,48 +125,3 @@ TEST(Functions, SplitList) {
"rounding = [[1, 2], [3, 4], [5], [6]]\n",
setup.print_output());
}
-
-TEST(Functions, DeclareArgs) {
- TestWithScope setup;
- Err err;
-
- // It is not legal to read the value of an argument declared in a
- // declare_args() from inside the call, but outside the call and in
- // a separate call should work.
-
- TestParseInput reading_from_same_call(R"(
- declare_args() {
- foo = true
- bar = foo
- })");
- reading_from_same_call.parsed()->Execute(setup.scope(), &err);
- ASSERT_TRUE(err.has_error());
-
- TestParseInput reading_from_outside_call(R"(
- declare_args() {
- foo = true
- }
-
- bar = foo
- assert(bar)
- )");
- err = Err();
- reading_from_outside_call.parsed()->Execute(setup.scope(), &err);
- ASSERT_FALSE(err.has_error());
-
- TestParseInput reading_from_different_call(R"(
- declare_args() {
- foo = true
- }
-
- declare_args() {
- bar = foo
- }
-
- assert(bar)
- )");
- err = Err();
- TestWithScope setup2;
- reading_from_different_call.parsed()->Execute(setup2.scope(), &err);
- ASSERT_FALSE(err.has_error());
-}
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/parse_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698