[cross posted from the WaSP to take comments]
Are you test infected? Do you work on dynamic sites and wish there was an automated way to run the output through the W3C validator? Do you wish it was integrated nicely with your unit testing framework?
If you're not on Rails, the technique should be pretty straightforward to adapt to your prefered language/framework. Just make a
POST request to
http://validator.w3.org/check sending parameters
fragment (your page, encoded) and
output=xml. Then check the response for a header called
x-w3c-validator-status to see if it says
Valid. If so, your test passed.