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

Side by Side Diff: tools/gn/visibility_unittest.cc

Issue 2187523003: Allow creation and modification of scopes in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments 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 unified diff | Download patch
« no previous file with comments | « tools/gn/value.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/err.h" 6 #include "tools/gn/err.h"
7 #include "tools/gn/label.h" 7 #include "tools/gn/label.h"
8 #include "tools/gn/scope.h"
8 #include "tools/gn/value.h" 9 #include "tools/gn/value.h"
9 #include "tools/gn/visibility.h" 10 #include "tools/gn/visibility.h"
10 11
11 TEST(Visibility, CanSeeMe) { 12 TEST(Visibility, CanSeeMe) {
12 Value list(nullptr, Value::LIST); 13 Value list(nullptr, Value::LIST);
13 list.list_value().push_back(Value(nullptr, "//rec/*")); // Recursive. 14 list.list_value().push_back(Value(nullptr, "//rec/*")); // Recursive.
14 list.list_value().push_back(Value(nullptr, "//dir:*")); // One dir. 15 list.list_value().push_back(Value(nullptr, "//dir:*")); // One dir.
15 list.list_value().push_back(Value(nullptr, "//my:name")); // Exact match. 16 list.list_value().push_back(Value(nullptr, "//my:name")); // Exact match.
16 17
17 Err err; 18 Err err;
(...skipping 25 matching lines...) Expand all
43 } 44 }
44 45
45 TEST(Visibility, Private) { 46 TEST(Visibility, Private) {
46 Err err; 47 Err err;
47 Visibility vis; 48 Visibility vis;
48 ASSERT_TRUE(vis.Set(SourceDir("//"), Value(nullptr, Value::LIST), &err)); 49 ASSERT_TRUE(vis.Set(SourceDir("//"), Value(nullptr, Value::LIST), &err));
49 50
50 EXPECT_FALSE(vis.CanSeeMe(Label(SourceDir("//random/"), "thing"))); 51 EXPECT_FALSE(vis.CanSeeMe(Label(SourceDir("//random/"), "thing")));
51 EXPECT_FALSE(vis.CanSeeMe(Label(SourceDir("//"), ""))); 52 EXPECT_FALSE(vis.CanSeeMe(Label(SourceDir("//"), "")));
52 } 53 }
OLDNEW
« no previous file with comments | « tools/gn/value.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698