Changeset 11057 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-09-27T09:25:46+02:00 (8 years ago)
Author:
simon04
Message:

Template engine: fix string representations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java

    r10846 r11057  
    174174        entry.appendText(sb, dataProvider);
    175175        Assert.assertEquals("name=waypointName, number=10", sb.toString());
     176        Assert.assertEquals("{special:everything}", entry.toString());
    176177    }
    177178
     
    333334        Assert.assertEquals("child2", sb.toString());
    334335    }
     336
     337    @Test
     338    public void testToStringCanBeParsedAgain() throws Exception {
     339        final String s1 = "?{ '{name} ({desc})' | '{name} ({cmt})' | '{name}' | '{desc}' | '{cmt}' }";
     340        final String s2 = new TemplateParser(s1).parse().toString();
     341        final String s3 = new TemplateParser(s2).parse().toString();
     342        Assert.assertEquals(s1, s2);
     343        Assert.assertEquals(s2, s3);
     344    }
    335345}
Note: See TracChangeset for help on using the changeset viewer.