-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extended docs regarding ValueAtQuantile() and added ValuesAreEquivale…
…nt() (#39) * [add] Extended docs regarding ValueAtQuantile() and added ValuesAreEquivalent() * [add] made New() documentation clearer * [fix] Fixes per PR review on New() * [fix] Fixed New() not to panic on numberOfSignificantValueDigits < 1 || numberOfSignificantValueDigits > 5. Adding linter check to CI * [add] Added whitebox testing for hdr.go ( specifically for New() numberOfSignificantValueDigits limits ).
- Loading branch information
1 parent
6663c35
commit 1dc8842
Showing
8 changed files
with
130 additions
and
590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
} |