(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func TestConvertUnsignedIntegers(t *testing.T) { |
| 109 | values := []any{ |
| 110 | uint8(42), |
| 111 | uint16(42), |
| 112 | uint32(42), |
| 113 | uint64(42), |
| 114 | uint(42), |
| 115 | myUint64{uint64(42)}, |
| 116 | } |
| 117 | |
| 118 | for _, value := range values { |
| 119 | output, err := converter{}.ConvertValue(value) |
| 120 | if err != nil { |
| 121 | t.Fatalf("%T type not convertible %s", value, err) |
| 122 | } |
| 123 | |
| 124 | if output != uint64(42) { |
| 125 | t.Fatalf("%T type not converted, got %#v %T", value, output, output) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | output, err := converter{}.ConvertValue(^uint64(0)) |
| 130 | if err != nil { |
| 131 | t.Fatal("uint64 high-bit not convertible", err) |
| 132 | } |
| 133 | |
| 134 | if output != ^uint64(0) { |
| 135 | t.Fatalf("uint64 high-bit converted, got %#v %T", output, output) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | func TestConvertJSON(t *testing.T) { |
| 140 | raw := json.RawMessage("{}") |
nothing calls this directly
no test coverage detected