(t *testing.T)
| 143 | } |
| 144 | |
| 145 | func TestCmp(t *testing.T) { |
| 146 | tests := []struct { |
| 147 | x, y string |
| 148 | c int |
| 149 | }{ |
| 150 | {x: "1", y: "10", c: -1}, |
| 151 | {x: "1", y: "1e1", c: -1}, |
| 152 | {x: "1e1", y: "1", c: 1}, |
| 153 | {x: ".1e1", y: "100e-1", c: -1}, |
| 154 | |
| 155 | {x: ".1e1", y: "100e-2", c: 0}, |
| 156 | {x: "1", y: ".1e1", c: 0}, |
| 157 | {x: "1", y: "1", c: 0}, |
| 158 | } |
| 159 | for _, tc := range tests { |
| 160 | t.Run(fmt.Sprintf("%s, %s", tc.x, tc.y), func(t *testing.T) { |
| 161 | x := newDecimal(t, testCtx, tc.x) |
| 162 | y := newDecimal(t, testCtx, tc.y) |
| 163 | c := x.Cmp(y) |
| 164 | if c != tc.c { |
| 165 | t.Fatalf("expected: %d, got: %d", tc.c, c) |
| 166 | } |
| 167 | }) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestModf(t *testing.T) { |
| 172 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…