refactor: change project structure and package name
This commit is contained in:
parent
c1468e8ae4
commit
ad10e9a062
163 changed files with 104 additions and 135 deletions
31
pkg/chart/histogram_series_test.go
Normal file
31
pkg/chart/histogram_series_test.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package chart
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/d-Rickyy-b/go-chart-x/v2/testutil"
|
||||
)
|
||||
|
||||
func TestHistogramSeries(t *testing.T) {
|
||||
// replaced new assertions helper
|
||||
|
||||
cs := ContinuousSeries{
|
||||
Name: "Test Series",
|
||||
XValues: LinearRange(1.0, 20.0),
|
||||
YValues: LinearRange(10.0, -10.0),
|
||||
}
|
||||
|
||||
hs := HistogramSeries{
|
||||
InnerSeries: cs,
|
||||
}
|
||||
|
||||
for x := 0; x < hs.Len(); x++ {
|
||||
csx, csy := cs.GetValues(0)
|
||||
hsx, hsy1, hsy2 := hs.GetBoundedValues(0)
|
||||
testutil.AssertEqual(t, csx, hsx)
|
||||
testutil.AssertTrue(t, hsy1 > 0)
|
||||
testutil.AssertTrue(t, hsy2 <= 0)
|
||||
testutil.AssertTrue(t, csy < 0 || (csy > 0 && csy == hsy1))
|
||||
testutil.AssertTrue(t, csy > 0 || (csy < 0 && csy == hsy2))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue