That should be fine. If they make selectors that have an a:visited (and whatever else) take the special code paths it should work fine. The style test in your example is going to be uniform across visited and unvisited unless it's something like:
a:visited .test { /* sneaky style */ }