Check if path contains slashes after stripping

If we do `cabal2nix test/`, we need to add a `./` prefix because the
path doesn't contain any slashes after stripping.