(t *testing.T)
| 17 | import "testing" |
| 18 | |
| 19 | func TestConstWithPrecision(t *testing.T) { |
| 20 | c := makeConstWithPrecision("123.456789") |
| 21 | expected := []string{ |
| 22 | "1E+2", // 0 |
| 23 | "1E+2", // 1 |
| 24 | "1.2E+2", // 2 |
| 25 | "123.5", "123.5", // 3, 4 |
| 26 | "123.45679", "123.45679", "123.45679", "123.45679", // 5..8 |
| 27 | "123.456789", "123.456789", "123.456789", // 9+ |
| 28 | } |
| 29 | for i, e := range expected { |
| 30 | if s := c.get(uint32(i)).String(); s != e { |
| 31 | t.Errorf("%d: expected %s, got %s", i, e, s) |
| 32 | } |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…