package main
import (
"fmt"
"reflect"
"testing"
)
var Sum func(a, b int) int // nolint: gochecknoglobals // DO NOT delete this comment!
func TestSum(t *testing.T) {
// write a test that checks Sum implementation
}
// DO NOT MODIFY
func main() {
var t testing.T
Sum = func(a, b int) int { return a + b }
TestSum(&t)
if reflect.ValueOf(&t).Elem().FieldByName("common").FieldByName("failed").Bool() {
fmt.Println("The test is incorrect!")
return
}
Sum = func(a, b int) int { return a + b * 2}
TestSum(&t)
if !reflect.ValueOf(&t).Elem().FieldByName("common").FieldByName("failed").Bool() {
fmt.Println("The test is incorrect!")
return
}
fmt.Println("OK")
}