Skip to content

Commit 0626201

Browse files
committed
Fixed support for sources that are actually recompiled.
1 parent 2c95cf5 commit 0626201

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/slather/coverage_info.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ def rate_branches_tested
7272

7373
def source_file_pathname_relative_to_repo_root
7474
test_path=source_file_pathname
75-
if ENV["COVERAGE_PATH_EQUIVALENCE"]
76-
test_path=Pathname("." + "#{source_file_pathname}".delete_prefix(ENV["COVERAGE_PATH_EQUIVALENCE"].delete_suffix(",.")))
75+
equivalence=ENV["COVERAGE_PATH_EQUIVALENCE"]
76+
if equivalence
77+
if "#{source_file_pathname}".start_with?(equivalence)
78+
test_path=Pathname("." + "#{source_file_pathname}".delete_prefix(equivalence.delete_suffix(",.")))
79+
end
7780
end
7881
test_path.realpath.relative_path_from(Pathname("./").realpath)
7982
end

0 commit comments

Comments
 (0)