Skip to content

Commit

Permalink
Adding additional tests for MinInt64 and SmallestNonZeroFloat64 (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed May 11, 2022
1 parent bcf9b6f commit 06912f0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tftypes/value_msgpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ func TestValueFromMsgPack(t *testing.T) {
value: NewValue(Number, big.NewFloat(1)),
typ: Number,
},
"int64-number": {
"int64-positive-number": {
hex: "cf7fffffffffffffff",
value: NewValue(Number, new(big.Float).SetInt64(math.MaxInt64)),
typ: Number,
},
"int64-negative-number": {
hex: "d38000000000000000",
value: NewValue(Number, new(big.Float).SetInt64(math.MinInt64)),
typ: Number,
},
"uint64-number": {
hex: "b43138343436373434303733373039353531363135",
value: NewValue(Number, new(big.Float).SetUint64(math.MaxUint64)),
Expand All @@ -85,11 +90,16 @@ func TestValueFromMsgPack(t *testing.T) {
value: NewValue(Number, big.NewFloat(1.5)),
typ: Number,
},
"float64-number": {
"float64-positive-number": {
hex: "cb7fefffffffffffff",
value: NewValue(Number, new(big.Float).SetFloat64(math.MaxFloat64)),
typ: Number,
},
"float64-negative-number": {
hex: "cb0000000000000001",
value: NewValue(Number, new(big.Float).SetFloat64(math.SmallestNonzeroFloat64)),
typ: Number,
},
"big-number": {
hex: "d96439393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939393939",
value: NewValue(Number, bigNumber),
Expand Down

0 comments on commit 06912f0

Please sign in to comment.