Adds support for go mod (finally) (#164)
This commit is contained in:
parent
962b9abdec
commit
c1468e8ae4
89 changed files with 1162 additions and 965 deletions
|
|
@ -3,20 +3,20 @@ package matrix
|
|||
import (
|
||||
"testing"
|
||||
|
||||
assert "github.com/blend/go-sdk/assert"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestPoly(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
// replaced new assertions helper
|
||||
var xGiven = []float64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
||||
var yGiven = []float64{1, 6, 17, 34, 57, 86, 121, 162, 209, 262, 321}
|
||||
var degree = 2
|
||||
|
||||
c, err := Poly(xGiven, yGiven, degree)
|
||||
assert.Nil(err)
|
||||
assert.Len(c, 3)
|
||||
testutil.AssertNil(t, err)
|
||||
testutil.AssertLen(t, c, 3)
|
||||
|
||||
assert.InDelta(c[0], 0.999999999, DefaultEpsilon)
|
||||
assert.InDelta(c[1], 2, DefaultEpsilon)
|
||||
assert.InDelta(c[2], 3, DefaultEpsilon)
|
||||
testutil.AssertInDelta(t, c[0], 0.999999999, DefaultEpsilon)
|
||||
testutil.AssertInDelta(t, c[1], 2, DefaultEpsilon)
|
||||
testutil.AssertInDelta(t, c[2], 3, DefaultEpsilon)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue