Re: CSS parsing tests.

Hi Emilio,

Generated tests as a compliment to the tests I'm contributing will be good.

Note that you very often won't be able to detect the serialization that
browsers use simply by reading the grammar.

BTW, test_valid_value() and test_computed_value() are checking that tested
values round-trip.

I haven't started writing computed value tests for shorthands. I also
haven't started testing the associations between shorthands and longhands.
There are likely lots of bugs waiting to be found.

Eric.

On Mon, May 20, 2019 at 8:09 PM Emilio Cobos Álvarez <emilio@mozilla.com>
wrote:

> Hi Eric,
>
> So there's a bunch of tests that you've been adding to WPT like[1].
> They're great, thanks for that.
>
> I wonder if we should auto-generate them using bikeshed.
>
> As part of reviewing the custom-properties spec I implemented the syntax
> parser[2]. It shouldn't be a lot of work to polish it, and wire it in
> such a way that it peeks data from the specs, parses the syntax of the
> property, and then uses the parsed representation to generate a bunch of
> tests, much like people are doing with idlharness, if my understanding
> is correct.
>
> It's less easy to add rules and exceptions to test how the property
> serializes exactly, but it should be trivial to test that the value
> parses, and that the serialized-value round-trips correctly.
>
> So I see it more like a complement to your tests than a replacement.
> Would that be something desirable?
>
>   -- Emilio
>
> [1]:
>
> https://github.com/web-platform-tests/wpt/commit/694ccf5329645c1a01a9f4b22dc19e26951de303
> [2]: https://github.com/emilio/css-typed-om-syntax
>

Received on Monday, 20 May 2019 10:47:52 UTC