Skip to content

Commit b962271

Browse files
committed
Add test for append(null) to LengthLimitingStringBuilder
1 parent 8eaf40e commit b962271

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/test/java/com/hubspot/jinjava/util/LengthLimitingStringBuilderTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.hubspot.jinjava.util;
22

3+
import static org.assertj.core.api.Assertions.assertThat;
34
import static org.assertj.core.api.Assertions.assertThatThrownBy;
45

56
import com.hubspot.jinjava.interpret.OutputTooBigException;
@@ -19,4 +20,11 @@ public void itDoesNotLimitWithZeroLength() {
1920
LengthLimitingStringBuilder sb = new LengthLimitingStringBuilder(0);
2021
sb.append("0123456789");
2122
}
23+
24+
@Test
25+
public void itHandlesNullStrings() {
26+
LengthLimitingStringBuilder sb = new LengthLimitingStringBuilder(10);
27+
sb.append(null);
28+
assertThat(sb.length()).isEqualTo(0);
29+
}
2230
}

0 commit comments

Comments
 (0)