X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Ftest_code%2FNextableInputStreamTest.java;fp=src%2Fbe%2Fnikiroo%2Futils%2Ftest_code%2FNextableInputStreamTest.java;h=4e5982363af1925d4b7422ba0eeb4a60ec69204a;hp=463a123652a14aebbc0962def6fc3f7a2e9106fd;hb=b440ca6a9a8d7cc3044e93ff91202fd448362cc6;hpb=62924cf3473d5b8d3ce827135d4c201f3879a359 diff --git a/src/be/nikiroo/utils/test_code/NextableInputStreamTest.java b/src/be/nikiroo/utils/test_code/NextableInputStreamTest.java index 463a123..4e59823 100644 --- a/src/be/nikiroo/utils/test_code/NextableInputStreamTest.java +++ b/src/be/nikiroo/utils/test_code/NextableInputStreamTest.java @@ -1,7 +1,6 @@ package be.nikiroo.utils.test_code; import java.io.ByteArrayInputStream; -import java.io.IOException; import be.nikiroo.utils.IOUtils; import be.nikiroo.utils.streams.NextableInputStream; @@ -177,12 +176,10 @@ public class NextableInputStreamTest extends TestLauncher { 11 })); // too big - try { - in.startsWith(new byte[] { 42, 12, 0, 127, 12, 51, 11, 12, - 0 }); - fail("Searching a prefix bigger than the array should throw an IOException"); - } catch (IOException e) { - } + assertEquals( + "A search term bigger than the whole data cannot be found in the data", + false, in.startsWith(new byte[] { 42, 12, 0, 127, 12, + 51, 11, 12, 0 })); in.close(); } @@ -209,13 +206,11 @@ public class NextableInputStreamTest extends TestLauncher { in.startsWith("Toto")); assertEquals("It actually does not start with that", false, in.startsWith("Fanfan et Toto vont à la mee")); - + // too big - try { - in.startsWith("Fanfan et Toto vont à la mer."); - fail("Searching a prefix bigger than the array should throw an IOException"); - } catch (IOException e) { - } + assertEquals( + "A search term bigger than the whole data cannot be found in the data", + false, in.startsWith("Fanfan et Toto vont à la mer.")); in.close(); }