Skip to content

Commit

Permalink
allow passing empty 'package' to 'java_test_suite'
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
mattnworb authored Nov 22, 2024
1 parent 50fec79 commit dfbcf3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/private/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_class_name(package, src, prefixes = []):
# safe to add the class name. While `get_package_name` does
# the right thing, the parameter passed by a user may not
# so we shall check once we have `pkg` just to be safe.
pkg = package if package else get_package_name(prefixes)
pkg = package != None if package else get_package_name(prefixes)
if len(pkg) and not pkg.endswith("."):
pkg = pkg + "."

Expand Down

0 comments on commit dfbcf3b

Please sign in to comment.