File: hdr_whitebox_test.go

package info (click to toggle)
golang-github-hdrhistogram-hdrhistogram-go 1.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 508 kB
  • sloc: makefile: 36
file content (15 lines) | stat: -rw-r--r-- 542 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package hdrhistogram

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func TestHistogram_New_internals(t *testing.T) {
	// test for numberOfSignificantValueDigits if higher than 5 the numberOfSignificantValueDigits will be forced to 5
	hist := New(1, 9007199254740991, 6)
	assert.Equal(t, int64(5), hist.significantFigures)
	// test for numberOfSignificantValueDigits if lower than 1 the numberOfSignificantValueDigits will be forced to 1
	hist = New(1, 9007199254740991, 0)
	assert.Equal(t, int64(1), hist.significantFigures)
}