Open bauersimon opened 2 weeks ago
even worse... the go coverage report of symflower test
is also wrong... the actual result of gotestsum
is:
mode: set
light/validateDate.go:3.51,6.17 2 1
light/validateDate.go:6.17,8.3 1 1
light/validateDate.go:9.2,9.29 1 1
light/validateDate.go:9.29,11.3 1 1
light/validateDate.go:12.2,12.13 1 1
light/validateDate.go:12.13,14.3 1 1
light/validateDate.go:15.2,15.16 1 1
light/validateDate.go:15.16,16.39 1 1
light/validateDate.go:16.39,17.16 1 1
light/validateDate.go:17.16,19.5 1 1
light/validateDate.go:20.9,21.16 1 1
light/validateDate.go:21.16,23.5 1 1
light/validateDate.go:25.8,26.31 1 1
light/validateDate.go:26.31,28.4 1 1
light/validateDate.go:31.2,31.13 1 1
which means that in lines 3-6 there are two statements covered:
monthDays := []int{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
year < 1583
But in the json
report of symflower test
that same range only has one coverage count...
Well... internally we just increment the coverage if the count>0
which... that is also wrong then.
also the json
output of symflower test
does not contain all the statements from the actual go coverage report :thinking:
in theory there are 16 statements in both implementations, so the correct result must be a coverage of 16 for both of them, not 7 and not 24
Java:
type="method"
in the clover.xml
), change this in symflower test
count>0
, change this in eval-dev-quality
clover
counts the total number of times a statement was coveredGo:
gotestsum
, BUG!count
is interpreted completely and make it the count of statements, not the count of executions, that's I think our only chance)go test
counts only if a statement was covered at all or not, this behavior could be changed to the Java behavior using covermode=count, however since Go counts ranges, then it is not clear anymore which distinct statements got executed
Looking at similar implementations in both languages (and tests with full 100% coverage reported by
gotestsum
andmaven
respectively):go
result of
symflower test
:coverage objects (all entries with count > 0): 7
java
result of
symflower test
coverage objects (all entries with count > 0): 24