Changeset 8206 in josm for trunk/test/unit


Ignore:
Timestamp:
2015-04-17T23:06:34+02:00 (8 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.

Location:
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss
Files:
2 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)
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy

    r7081 r8206  
    6363        r.addMember(new RelationMember("my_role", n))
    6464
    65         Environment e = new Environment().withPrimitive(n).withParent(r).withLinkContext().withIndex(0)
     65        Environment e = new Environment().withPrimitive(n).withParent(r).withLinkContext().withIndex(0, r.membersCount)
    6666
    6767        Condition cond = new Condition.RoleCondition("my_role", Op.EQ)
     
    7878        r.addMember(new RelationMember("my_role", n))
    7979
    80         Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0).withLinkContext()
     80        Environment e = new Environment().withPrimitive(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    8181
    8282        Condition cond = Condition.createKeyValueCondition("role", "my_role", Op.NEQ, Context.LINK, false)
Note: See TracChangeset for help on using the changeset viewer.