MCPcopy
hub / github.com/shopspring/decimal / TestDecimal_IsInteger

Function TestDecimal_IsInteger

decimal_test.go:2836–2862  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2834}
2835
2836func TestDecimal_IsInteger(t *testing.T) {
2837 for _, testCase := range []struct {
2838 Dec string
2839 IsInteger bool
2840 }{
2841 {"0", true},
2842 {"0.0000", true},
2843 {"0.01", false},
2844 {"0.01010101010000", false},
2845 {"12.0", true},
2846 {"12.00000000000000", true},
2847 {"12.10000", false},
2848 {"9999.0000", true},
2849 {"99999999.000000000", true},
2850 {"-656323444.0000000000000", true},
2851 {"-32768.01234", false},
2852 {"-32768.0123423562623600000", false},
2853 } {
2854 d, err := NewFromString(testCase.Dec)
2855 if err != nil {
2856 t.Fatal(err)
2857 }
2858 if d.IsInteger() != testCase.IsInteger {
2859 t.Errorf("expect %t, got %t, for %s", testCase.IsInteger, d.IsInteger(), testCase.Dec)
2860 }
2861 }
2862}
2863
2864func TestDecimal_ExpHullAbrham(t *testing.T) {
2865 for _, testCase := range []struct {

Callers

nothing calls this directly

Calls 2

NewFromStringFunction · 0.85
IsIntegerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…