test(math): fix FormatDec test (#15215)
This commit is contained in:
parent
17ba80df7c
commit
1273c05ada
@ -671,7 +671,7 @@ func BenchmarkLegacyQuoRoundupMut(b *testing.B) {
|
||||
func TestFormatDec(t *testing.T) {
|
||||
type decimalTest []string
|
||||
var testcases []decimalTest
|
||||
raw, err := os.ReadFile("../x/tx/textual/internal/testdata/decimals.json")
|
||||
raw, err := os.ReadFile("./testdata/decimals.json")
|
||||
require.NoError(t, err)
|
||||
err = json.Unmarshal(raw, &testcases)
|
||||
require.NoError(t, err)
|
||||
|
||||
47
math/testdata/decimals.json
vendored
Normal file
47
math/testdata/decimals.json
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
[
|
||||
["0", "0"],
|
||||
["1", "1"],
|
||||
["12", "12"],
|
||||
["123", "123"],
|
||||
["1234", "1'234"],
|
||||
["0.1", "0.1"],
|
||||
["0.01", "0.01"],
|
||||
["0.001", "0.001"],
|
||||
["0.0001", "0.0001"],
|
||||
["0.00001", "0.00001"],
|
||||
["0.000001", "0.000001"],
|
||||
["0.0000001", "0.0000001"],
|
||||
["0.00000001", "0.00000001"],
|
||||
["0.000000001", "0.000000001"],
|
||||
["0.0000000001", "0.0000000001"],
|
||||
["0.00000000001", "0.00000000001"],
|
||||
["0.000000000001", "0.000000000001"],
|
||||
["0.0000000000001", "0.0000000000001"],
|
||||
["0.00000000000001", "0.00000000000001"],
|
||||
["0.000000000000001", "0.000000000000001"],
|
||||
["0.0000000000000001", "0.0000000000000001"],
|
||||
["0.00000000000000001", "0.00000000000000001"],
|
||||
["0.000000000000000001", "0.000000000000000001"],
|
||||
["0.100000000000000000", "0.1"],
|
||||
["0.010000000000000000", "0.01"],
|
||||
["0.001000000000000000", "0.001"],
|
||||
["0.000100000000000000", "0.0001"],
|
||||
["0.000010000000000000", "0.00001"],
|
||||
["0.000001000000000000", "0.000001"],
|
||||
["0.000000100000000000", "0.0000001"],
|
||||
["0.000000010000000000", "0.00000001"],
|
||||
["0.000000001000000000", "0.000000001"],
|
||||
["0.000000000100000000", "0.0000000001"],
|
||||
["0.000000000010000000", "0.00000000001"],
|
||||
["0.000000000001000000", "0.000000000001"],
|
||||
["0.000000000000100000", "0.0000000000001"],
|
||||
["0.000000000000010000", "0.00000000000001"],
|
||||
["0.000000000000001000", "0.000000000000001"],
|
||||
["0.000000000000000100", "0.0000000000000001"],
|
||||
["0.000000000000000010", "0.00000000000000001"],
|
||||
["0.000000000000000001", "0.000000000000000001"],
|
||||
["-10.0", "-10"],
|
||||
["-10000", "-10'000"],
|
||||
["-9999", "-9'999"],
|
||||
["-999999999999", "-999'999'999'999"]
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user