Ignore:
Timestamp:
2015-04-17T23:06:34+02:00 (9 years ago)
Author:
simon04
Message:

fix #10299 - MapCSS index for last element of object

Negative index numbers count from last to first, so >[index=-1] matches the last one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy

    r7081 r8206  
    7777        r.addMember(new RelationMember("my_role", n))
    7878
    79         Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0).withLinkContext()
     79        Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    8080
    8181        Condition cond = Condition.createKeyCondition("my_role", false, null, Context.LINK)
     
    9292        r.addMember(new RelationMember("my_role", n))
    9393
    94         Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0).withLinkContext()
     94        Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    9595
    9696        Condition cond = Condition.createKeyCondition("another_role", false, null, Context.LINK)
Note: See TracChangeset for help on using the changeset viewer.