@@ -45,40 +45,18 @@ public void testFlagEqualsValueForm() throws Exception {
45
45
assertThat (result .getResidue ()).isEmpty ();
46
46
}
47
47
48
- // test --@main_workspace//flag=value parses out to //flag=value
49
- // test --@other_workspace//flag=value parses out to @other_workspace//flag=value
48
+ // test --@workspace//flag=value
50
49
@ Test
51
50
public void testFlagNameWithWorkspace () throws Exception {
52
51
writeBasicIntFlag ();
53
- scratch .file ("test/repo2/WORKSPACE" );
54
- scratch .file (
55
- "test/repo2/defs.bzl" ,
56
- "def _impl(ctx):" ,
57
- " pass" ,
58
- "my_flag = rule(" ,
59
- " implementation = _impl," ,
60
- " build_setting = config.int(flag = True)," ,
61
- ")" );
62
- scratch .file (
63
- "test/repo2/BUILD" ,
64
- "load(':defs.bzl', 'my_flag')" ,
65
- "my_flag(name = 'flag2', build_setting_default=2)" );
66
-
67
- rewriteWorkspace (
68
- "workspace(name = 'starlark_options_test')" ,
69
- "local_repository(" ,
70
- " name = 'repo2'," ,
71
- " path = 'test/repo2'," ,
72
- ")" );
52
+ rewriteWorkspace ("workspace(name = 'starlark_options_test')" );
73
53
74
54
OptionsParsingResult result =
75
- parseStarlarkOptions (
76
- "--@starlark_options_test//test:my_int_setting=666 --@repo2//:flag2=222" );
55
+ parseStarlarkOptions ("--@starlark_options_test//test:my_int_setting=666" );
77
56
78
- assertThat (result .getStarlarkOptions ()).hasSize (2 );
79
- assertThat (result .getStarlarkOptions ().get ("//test:my_int_setting" ))
57
+ assertThat (result .getStarlarkOptions ()).hasSize (1 );
58
+ assertThat (result .getStarlarkOptions ().get ("@starlark_options_test //test:my_int_setting" ))
80
59
.isEqualTo (StarlarkInt .of (666 ));
81
- assertThat (result .getStarlarkOptions ().get ("@repo2//:flag2" )).isEqualTo (StarlarkInt .of (222 ));
82
60
assertThat (result .getResidue ()).isEmpty ();
83
61
}
84
62
0 commit comments