Add test for failsafe.

This commit is contained in:
A Samuel Pottinger
2023-05-09 18:41:36 +00:00
parent 5c3fa69f57
commit 674cfe0766

View File

@@ -72,6 +72,13 @@ public class VariableNodeTests {
Assert.assertEquals(node.getStringValue(), "instance of int[5][7][][]");
}
@Test
public void describeArrayFailsafe() {
Value value = buildMockValue("instance of int[x][7] (id=998)");
VariableNode node = new VariableNode("test", "int[][][][]", value);
Assert.assertEquals(node.getStringValue(), "instance of int[x][7] (id=998));
}
private Value buildMockValue(String toStringValue) {
Value value = Mockito.mock(Value.class);
Mockito.when(value.toString()).thenReturn(toStringValue);