File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
main/java/org/metafacture/metafix
test/java/org/metafacture/metafix Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public class FixPath {
3434
3535 private static final String ASTERISK = "*" ;
3636
37- private static final String INDEX_SUBPATH_PATTERN = Value .FIELD_PATH_SEPARATOR_PATTERN + "\\ d" + Value .FIELD_PATH_SEPARATOR_PATTERN ;
37+ private static final String INDEX_SUBPATH_PATTERN = Value .FIELD_PATH_SEPARATOR_PATTERN + "\\ d+ " + Value .FIELD_PATH_SEPARATOR_PATTERN ;
3838 private static final String ASTERISK_SUBPATH = Value .FIELD_PATH_SEPARATOR + ASTERISK + Value .FIELD_PATH_SEPARATOR ;
3939
4040 private String [] path ;
Original file line number Diff line number Diff line change @@ -166,4 +166,15 @@ public void shouldThrowExceptionForInvalidFixFile() {
166166 // TODO: Test logging statements
167167 }
168168
169+ @ Test
170+ public void shouldMatchTwoDigitIndexInPath () {
171+ final String wildcardPath = "field.*.field" ;
172+ final String concretePath = "field.10.field" ;
173+ final Value value = new Value ("" ).withPathSet (concretePath );
174+ final FixPath result = new FixPath (wildcardPath ).to (value , 15 );
175+ // `value` has a `concretePath` matching the `wildcardPath`, so
176+ // `result` should be that path, not a path using the passed index:
177+ Assertions .assertEquals (concretePath , result .toString ());
178+ }
179+
169180}
You can’t perform that action at this time.
0 commit comments