-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed that URL does not contain the "empty" #103
Conversation
Order to remove the hierarchy of unnecessary 'empty' from a URL. Because the generated HTML links does not work correctly.
This reverts #9. I wonder what problem was fixed by that PR. |
Could you please include a unit tests for your fix? It's very helpful for tracking regressions. |
Thank you comment @gslowikowski @Kwestor Since there is no test of 'ScoverageHtmlWriter.scala', and try to write, including the other part. So, I want you to wait a little. PR #9 is not an absolute path the HTML URL of, is intended to change the relative path, this PR does not change for that point. I just only to such does not include the 'empty' in the URL. We acquires the coverage module following such directory structure...
Following such HTML is output.
At this time, since the URL of overview.html has become as follows, I just want to fix this.
Since overview.html and Class1.scala.html is created in the same directory, if delete the extra 'empty', it becomes as to function as the correct link. |
Added test code. |
Fixed that URL does not contain the "empty"
I haven't time to test it before. When running tests on Windows
|
See #79 (comment), it's probably the same problem. It only manifests on Windows, as on Linux paths are wrong, but parsable. |
I analyzed this case and I see many problems with this PR:
val class2 = getClass.getResource("forHtmlWriter/src/main/scala/subdir/Class2.scala").getFile()
val class1 = getClass.getResource("forHtmlWriter/src/main/scala/Class1.scala").getFile()
coverage.add(
Statement(class2,
Location("coverage.sample", "Class2","Class", ClassType.Object, "msg_test", class2),
2, 57, 77, 4, "scala.this.Predef.println("test code")",
"scala.Predef.println", "Apply", false, 0)
)
coverage.add(
Statement(class1,
Location("coverage.sample", "Class1","Class", ClassType.Object, "msg_coverage", class1),
1, 61, 96, 4, "scala.this.Predef.println("measure coverage of code")",
"scala.Predef.println", "Apply", false, 0)
) should be changed to: val class2 = new File(getClass.getResource("forHtmlWriter/src/main/scala/subdir/Class2.scala").getFile()).getCanonicalPath()
val class1 = new File(getClass.getResource("forHtmlWriter/src/main/scala/Class1.scala").getFile()).getCanonicalPath()
coverage.add(
Statement(class2,
Location("coverage.sample", "Class2", "Class2", ClassType.Class, "msg_test", class2),
2, 60, 80, 4, "scala.this.Predef.println(\"test code\")",
"scala.Predef.println", "Apply", false, 0)
)
coverage.add(
Statement(class1,
Location("coverage.sample", "Class1", "Class1", ClassType.Class, "msg_coverage", class1),
1, 64, 99, 4, "scala.this.Predef.println(\"measure coverage of code\")",
"scala.Predef.println", "Apply", false, 0)
) So, |
When we generate a coverage report of source code that is placed directly below
'src/main/scala/'
, the link to the report of HTML, 'empty' string is inserted that, it is not even properly reaction click.Example: