Skip to content

Commit 974602f

Browse files
authored
allow passing empty 'package' to 'java_test_suite' (#312)
If for whatever reason one has test classes in the unnamed package, the current logic for detecting the full classname will return something like `src.test.java.FoobarTest` when you specify `package = ""` because of the truthiness test in `get_class_name`.
1 parent 27d392c commit 974602f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/private/package.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_class_name(package, src, prefixes = []):
3434
# safe to add the class name. While `get_package_name` does
3535
# the right thing, the parameter passed by a user may not
3636
# so we shall check once we have `pkg` just to be safe.
37-
pkg = package if package else get_package_name(prefixes)
37+
pkg = package if package != None else get_package_name(prefixes)
3838
if len(pkg) and not pkg.endswith("."):
3939
pkg = pkg + "."
4040

0 commit comments

Comments
 (0)