Skip to content

Commit f09db4d

Browse files
committed
Add more tests
1 parent 11f218f commit f09db4d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/test/java/at/favre/lib/bytes/BytesMiscTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,13 @@ public void byteAt() throws Exception {
148148
}
149149

150150
try {
151-
assertEquals(0, Bytes.allocate(1).byteAt(1));
151+
Bytes.allocate(1).byteAt(1);
152+
fail();
153+
} catch (IndexOutOfBoundsException e) {
154+
}
155+
156+
try {
157+
Bytes.allocate(16).byteAt(-1);
152158
fail();
153159
} catch (IndexOutOfBoundsException e) {
154160
}
@@ -186,5 +192,8 @@ public void readOnly() throws Exception {
186192
fail();
187193
} catch (ReadOnlyBufferException e) {
188194
}
195+
196+
Bytes b = Bytes.from(example_bytes_twentyfour).readOnly();
197+
assertSame(b, b.readOnly());
189198
}
190199
}

0 commit comments

Comments
 (0)