Add solutions for testdata sumbssions related to new coverage calculation logic.

This commit is contained in:
Alexander Vasilyev 2020-03-27 01:22:10 +03:00 committed by Fedor Korotkiy
parent 12396125e7
commit b2081be19b
5 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,11 @@
// +build solution
package big
import "testing"
func TestFunc7(t *testing.T) {
if got, want := Func7(), 7; got != want {
t.Errorf("Func7() = %d; want %d", got, want)
}
}

View file

@ -0,0 +1,11 @@
// +build solution
package small
import "testing"
func TestFunc3(t *testing.T) {
if got, want := Func3(), 3; got != want {
t.Errorf("Func3() = %d; want %d", got, want)
}
}

View file

@ -0,0 +1,14 @@
// +build solution
package extracoverage
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestSum(t *testing.T) {
require.Equal(t, int64(2), Sum(1, 1))
require.Equal(t, int64(1), Sum(0, 1))
}

View file

@ -0,0 +1,12 @@
// +build solution
package product
import "testing"
func TestProduct(t *testing.T) {
x, y := 3, 3
if got, want := Product(x, y), 9; got != want {
t.Errorf("Product(%d, %d) = %d; want %d", x, y, got, want)
}
}

View file

@ -0,0 +1,12 @@
// +build solution
package sum
import "testing"
func TestSum(t *testing.T) {
x, y := 1, 1
if got, want := Sum(x, y), 2; got != want {
t.Errorf("Sum(%d, %d) = %d; want %d", x, y, got, want)
}
}