diff --git a/instrumenter.go b/instrumenter.go index dd37e2d..ee655b8 100644 --- a/instrumenter.go +++ b/instrumenter.go @@ -559,8 +559,10 @@ func (i *instrumenter) visitExpr(exprPtr *ast.Expr) { if expr.Op.Precedence() == token.EQL.Precedence() { *exprPtr = i.wrap(expr) } - // TODO: i.visitExpr(&expr.X) - // TODO: i.visitExpr(&expr.Y) + if expr.Op != token.LAND && expr.Op != token.LOR { + i.visitExpr(&expr.X) + i.visitExpr(&expr.Y) + } case *ast.KeyValueExpr: i.visitExpr(&expr.Key) diff --git a/testdata/instrumenter/BinaryExpr.go b/testdata/instrumenter/BinaryExpr.go index 17b9d94..32d3394 100644 --- a/testdata/instrumenter/BinaryExpr.go +++ b/testdata/instrumenter/BinaryExpr.go @@ -55,5 +55,5 @@ func binaryExpr(i int, a bool, b bool) { i >= 34 && i <= 35 m := map[bool]int{} - _ = m[i == 41] == m[i == 42] // TODO: instrument + _ = m[i == 41] == m[i == 42] } diff --git a/testdata/instrumenter/BinaryExpr.gobco b/testdata/instrumenter/BinaryExpr.gobco index 60e5ea1..550e12d 100644 --- a/testdata/instrumenter/BinaryExpr.gobco +++ b/testdata/instrumenter/BinaryExpr.gobco @@ -27,7 +27,7 @@ func binaryExpr(i int, a bool, b bool) { gobcoCover(16, gobcoCover(21, i >= 34) && gobcoCover(22, i <= 35)) m := map[bool]int{} - _ = gobcoCover(23, m[i == 41] == m[i == 42]) + _ = gobcoCover(23, m[gobcoCover(24, i == 41)] == m[gobcoCover(25, i == 42)]) } // :15:6: "i > 0" @@ -54,3 +54,5 @@ func binaryExpr(i int, a bool, b bool) { // :55:3: "i >= 34" // :55:14: "i <= 35" // :58:6: "m[i == 41] == m[i == 42]" +// :58:8: "i == 41" +// :58:22: "i == 42"