(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestCmp128(t *testing.T) { |
| 9 | tests := []struct { |
| 10 | x uint128 |
| 11 | y uint128 |
| 12 | k int |
| 13 | }{ |
| 14 | { |
| 15 | x: makeUint128(0, 0), |
| 16 | y: makeUint128(0, 0), |
| 17 | k: 0, |
| 18 | }, |
| 19 | { |
| 20 | x: makeUint128(0, 1), |
| 21 | y: makeUint128(0, 0), |
| 22 | k: +1, |
| 23 | }, |
| 24 | { |
| 25 | x: makeUint128(0, 0), |
| 26 | y: makeUint128(0, 1), |
| 27 | k: -1, |
| 28 | }, |
| 29 | { |
| 30 | x: makeUint128(1, 0), |
| 31 | y: makeUint128(0, 1), |
| 32 | k: +1, |
| 33 | }, |
| 34 | { |
| 35 | x: makeUint128(0, 1), |
| 36 | y: makeUint128(1, 0), |
| 37 | k: -1, |
| 38 | }, |
| 39 | } |
| 40 | |
| 41 | for _, test := range tests { |
| 42 | t.Run(fmt.Sprintf("cmp128(%s,%s)", test.x, test.y), func(t *testing.T) { |
| 43 | if k := cmp128(test.x, test.y); k != test.k { |
| 44 | t.Error(k, "!=", test.k) |
| 45 | } |
| 46 | }) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func TestAdd128(t *testing.T) { |
| 51 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…