﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17129	Cannot add assertMatch/assertNoMatch declarations with :selected pseudoclass	taylor.smock	team	"It is not currently possible to do the following:
{{{
#!mapcss
way[highway][turn:lanes][oneway][count(split(""|"", tag(""turn:lanes""))) != tag(""lanes"")]:selected, 
way[highway][turn:lanes][!oneway][2 * count(split(""|"", tag(""turn:lanes""))) != tag(""lanes"")]:selected, 
way[highway][turn:lanes][!lanes]:selected { 
        throwWarning: tr(""turn:lanes do not match lanes"");
        fixAdd: concat(""lanes="", count(split(""|"", tag(""turn.lanes"")));
        assertMatch: ""way highway=primary lanes=4 turn:lanes=left|through|through;right"";
        assertNoMatch: ""way highway=primary lanes=4 turn:lanes=left;through|through;right"";
}
}}}

Since I've got another test without the :selected psuedoclass, I can move the assertMatch/assertNoMatch to that test, e.g.
{{{
#!mapcss
way[highway][turn:lanes][oneway][count(split(""|"", tag(""turn:lanes""))) != tag(""lanes"")], 
way[highway][turn:lanes][!oneway][2 * count(split(""|"", tag(""turn:lanes""))) != tag(""lanes"")], 
way[highway][turn:lanes][!lanes] { 
        throwWarning: tr(""turn:lanes do not match lanes"");
        assertMatch: ""way highway=primary lanes=4 turn:lanes=left|through|through;right"";
        assertNoMatch: ""way highway=primary lanes=4 turn:lanes=left;through|through;right"";
}
}}}
instead of
{{{
#!mapcss
way[highway][turn:lanes][oneway][count(split(""|"", tag(""turn:lanes""))) != tag(""lanes"")], 
way[highway][turn:lanes][!oneway][2 * count(split(""|"", tag(""turn:lanes""))) != tag(""lanes"")], 
way[highway][turn:lanes][!lanes] { 
        throwWarning: tr(""turn:lanes do not match lanes"");
}
}}}
and this should be possible for the vast majority of cases.

#17058 is similar, in that fake primitives are probably not selected when they should be (in that bug, the fake primitives where not being created in the country the tests where inside).

Use cases:
1) There is a common issue where the fix is almost always the same, but should be verified using aerial imagery/street level imagery, and selection is one way to ensure that.
  Possible alternative: way|z21-[JOSM_search(""inview"")] {...} -- this is probably a much better alternative than the initial :selected for this use case."	defect	new	minor		Core validator	latest		mapcss	
