| 110 | } |
| 111 | |
| 112 | static void test_slice() |
| 113 | { |
| 114 | Bytes b = {1, 2, 3}; |
| 115 | |
| 116 | Bytes bs = b.slice(1, 1); |
| 117 | assert((bs == Bytes{2})); |
| 118 | |
| 119 | bs = b.slice(1, 2); |
| 120 | assert((bs == Bytes{2, 3})); |
| 121 | |
| 122 | bs = b.slice(1, 3); |
| 123 | assert((bs == Bytes{2, 3, 0})); |
| 124 | |
| 125 | bs = b.slice(4, 2); |
| 126 | assert((bs == Bytes{0, 0})); |
| 127 | } |
| 128 | |
| 129 | static void test_split() |
| 130 | { |