(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestEncodeSingleMask(t *testing.T) { |
| 73 | for i, tc := range testCasesSingle { |
| 74 | e := tc.mask |
| 75 | t.Run(strconv.FormatInt(int64(i), 10), func(t *testing.T) { |
| 76 | got := e.Encode(tc.in) |
| 77 | if got != tc.out { |
| 78 | t.Errorf("Encode(%q) want %q got %q", tc.in, tc.out, got) |
| 79 | } |
| 80 | got2 := e.Decode(got) |
| 81 | if got2 != tc.in { |
| 82 | t.Errorf("Decode(%q) want %q got %q", got, tc.in, got2) |
| 83 | } |
| 84 | }) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestEncodeSingleMaskEdge(t *testing.T) { |
| 89 | for i, tc := range testCasesSingleEdge { |