Closed junedev closed 1 year ago
Hey, I checked out the code of the test runner a bit. I could not fix the problem. What I noticed is, that there is no empty line, if the test cases are formatted like this (opening { one line higher):
tests := []struct {
name string
productionRate int
successRate float64
want float64
}{{
name: "calculate working cars per hour for production rate 0",
productionRate: 0,
successRate: 100,
want: 0.0,
},
[...]
I tried different things in ast.go
, especially in func getSubCode
(mostly lhs1
and rhs1
)
Maybe these notes help in the future
hmm
If the extraction of the individual test from a list of test cases worked out, the result has a redundant empty line after the struct definition part: