summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index e8a1a7c83..0033f319d 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1229,6 +1229,24 @@ func TestJavaSdkLibrary(t *testing.T) {
}
}
+func TestJavaSdkLibrary_InvalidScopes(t *testing.T) {
+ testJavaError(t, `module "foo": enabled api scope "system" depends on disabled scope "public"`, `
+ java_sdk_library {
+ name: "foo",
+ srcs: ["a.java", "b.java"],
+ api_packages: ["foo"],
+ // Explicitly disable public to test the check that ensures the set of enabled
+ // scopes is consistent.
+ public: {
+ enabled: false,
+ },
+ system: {
+ enabled: true,
+ },
+ }
+ `)
+}
+
var compilerFlagsTestCases = []struct {
in string
out bool