mirror of https://github.com/k3s-io/k3s
Merge pull request #53862 from jianglingxia/jlx-quantity
Automatic merge from submit-queue (batch tested with PRs 53862, 53974). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. unused para useInfDec in quantity_test **What this PR does / why we need it**: the para useInfDec unused and some comment error,so fix it! **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/6/head
commit
1a80501fab
|
@ -29,8 +29,6 @@ import (
|
||||||
inf "gopkg.in/inf.v0"
|
inf "gopkg.in/inf.v0"
|
||||||
)
|
)
|
||||||
|
|
||||||
var useInfDec bool
|
|
||||||
|
|
||||||
func amount(i int64, exponent int) infDecAmount {
|
func amount(i int64, exponent int) infDecAmount {
|
||||||
// See the below test-- scale is the negative of an exponent.
|
// See the below test-- scale is the negative of an exponent.
|
||||||
return infDecAmount{inf.NewDec(i, inf.Scale(-exponent))}
|
return infDecAmount{inf.NewDec(i, inf.Scale(-exponent))}
|
||||||
|
@ -79,7 +77,7 @@ func TestQuantityParseZero(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestQuantityParseNonNumericError ensures that when a non-numeric string is parsed
|
// TestQuantityParseNonNumericPanic ensures that when a non-numeric string is parsed
|
||||||
// it panics
|
// it panics
|
||||||
func TestQuantityParseNonNumericPanic(t *testing.T) {
|
func TestQuantityParseNonNumericPanic(t *testing.T) {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
@ -140,7 +138,7 @@ func TestQuantitySubZeroPreservesSuffix(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verifies that you get 0 as canonical value if internal value is 0, and not 0<suffix>
|
// TestQuantityCanocicalizeZero verifies that you get 0 as canonical value if internal value is 0, and not 0<suffix>
|
||||||
func TestQuantityCanocicalizeZero(t *testing.T) {
|
func TestQuantityCanocicalizeZero(t *testing.T) {
|
||||||
val := MustParse("1000m")
|
val := MustParse("1000m")
|
||||||
val.i.Sub(int64Amount{value: 1})
|
val.i.Sub(int64Amount{value: 1})
|
||||||
|
|
Loading…
Reference in New Issue