mirror of
https://github.com/processing/processing4.git
synced 2026-01-27 02:11:08 +01:00
Clarify unneeded section.
This commit is contained in:
@@ -56,7 +56,7 @@ public class VariableNode implements MutableTreeNode {
|
||||
public static final int TYPE_VOID = 11;
|
||||
|
||||
private static final Pattern ARRAY_REGEX = Pattern.compile(
|
||||
"^(?<prefix>[^\\]]+)(?<unbounded>(\\[\\])*)(?<bounded>(\\[\\d+\\])+).*$"
|
||||
"^(?<prefix>[^\\[]+)(?<unbounded>(\\[\\])*)(?<bounded>(\\[\\d+\\])+)(?<unneeded>[^\\[]*)$"
|
||||
);
|
||||
|
||||
protected String type;
|
||||
|
||||
@@ -74,9 +74,16 @@ public class VariableNodeTests {
|
||||
|
||||
@Test
|
||||
public void describeArrayFailsafe() {
|
||||
Value value = buildMockValue("instance of int[x][7] (id=998)");
|
||||
Value value = buildMockValue("instance of int[x][7] (id=98)");
|
||||
VariableNode node = new VariableNode("test", "int[][][][]", value);
|
||||
Assert.assertEquals(node.getStringValue(), "instance of int[x][7] (id=998));
|
||||
Assert.assertEquals(node.getStringValue(), "instance of int[x][7] (id=98)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void describeArrayUnexpectedOrder() {
|
||||
Value value = buildMockValue("instance of int[7][] (id=98)");
|
||||
VariableNode node = new VariableNode("test", "int[][][][]", value);
|
||||
Assert.assertEquals(node.getStringValue(), "instance of int[7][] (id=98)");
|
||||
}
|
||||
|
||||
private Value buildMockValue(String toStringValue) {
|
||||
|
||||
Reference in New Issue
Block a user