@Test
public void shouldMatchTypeWithArrayDimensionsFollowingLengthAndScale() {

    pattern = parser.parse(TYPE, "DECIMAL[(M[,D])]{n}");
    assertThat(pattern).isNotNull();
    type = pattern.match(text("DECIMAL[3]"));
    assertThat(type.arrayDimensions()).containsOnly(3);
    assertThat(type.length()).isEqualTo(-1);
    assertThat(type.scale()).isEqualTo(-1);
    assertThat(type.name()).isEqualTo("DECIMAL");
    assertThat(type.expression()).isEqualTo("DECIMAL[3]");
    assertThat(type.jdbcType()).isEqualTo(TYPE);
    type = pattern.match(text("DECIMAL(5,1)[3][6]"));
    assertThat(type.arrayDimensions()).containsOnly(3, 6);
    assertThat(type.length()).isEqualTo(5);
    assertThat(type.scale()).isEqualTo(1);
    assertThat(type.name()).isEqualTo("DECIMAL");
    assertThat(type.expression()).isEqualTo("DECIMAL(5,1)[3][6]");
    assertThat(type.jdbcType()).isEqualTo(TYPE);
}