diff options
Diffstat (limited to 'guava-tests/test/com/google/common/io/CharStreamsTest.java')
-rw-r--r-- | guava-tests/test/com/google/common/io/CharStreamsTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/guava-tests/test/com/google/common/io/CharStreamsTest.java b/guava-tests/test/com/google/common/io/CharStreamsTest.java index 3007f0928..9b2c24e28 100644 --- a/guava-tests/test/com/google/common/io/CharStreamsTest.java +++ b/guava-tests/test/com/google/common/io/CharStreamsTest.java @@ -267,6 +267,21 @@ public class CharStreamsTest extends IoTestCase { String test = "Test string for NullWriter"; nullWriter.write(test); nullWriter.write(test, 2, 10); + nullWriter.append(null); + nullWriter.append(null, 0, 4); + + try { + nullWriter.append(null, -1, 4); + fail(); + } catch (IndexOutOfBoundsException expected) { + } + + try { + nullWriter.append(null, 0, 5); + fail(); + } catch (IndexOutOfBoundsException expected) { + } + // nothing really to assert? assertSame(CharStreams.nullWriter(), CharStreams.nullWriter()); } |