tests: omit default suffix in test names

If the test file is `default.nix`, we don't need to append the filename
to the test namespace.
This commit is contained in:
Matt Sturgeon 2024-12-27 18:49:02 +00:00
parent ae612f8249
commit e679ee91fa
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -36,7 +36,9 @@ let
in
if type == "regular" then
lib.optional (lib.hasSuffix ".nix" name) (
handleTestFile file (namespace ++ [ (lib.removeSuffix ".nix" name) ])
handleTestFile file (
namespace ++ lib.optional (name != "default.nix") (lib.removeSuffix ".nix" name)
)
)
else
fetchTests file (namespace ++ [ name ]);