void () { final ParseResult result = PyNewStyleStringFormatParser.parse("'{foo} {} {bar} {0} {}'"); final List<Field> topLevelFields = result.getFields(); UsefulTestCase.assertSize(5, topLevelFields); assertEquals("foo", topLevelFields.get(0).getMappingKey()); assertNull(topLevelFields.get(0).getManualPosition()); assertNull(topLevelFields.get(0).getAutoPosition()); assertNull(topLevelFields.get(1).getMappingKey()); assertNull(topLevelFields.get(1).getManualPosition()); TestCase.assertEquals(0, (int)topLevelFields.get(1).getAutoPosition()); assertEquals("bar", topLevelFields.get(2).getMappingKey()); assertNull(topLevelFields.get(2).getManualPosition()); assertNull(topLevelFields.get(2).getAutoPosition()); assertNull(topLevelFields.get(3).getMappingKey()); TestCase.assertEquals(0, (int)topLevelFields.get(3).getManualPosition()); assertNull(topLevelFields.get(3).getAutoPosition()); assertNull(topLevelFields.get(4).getMappingKey()); assertNull(topLevelFields.get(4).getManualPosition()); TestCase.assertEquals(1, (int)topLevelFields.get(4).getAutoPosition()); }