W3C home > Mailing lists > Public > public-html-testsuite@w3.org > December 2010

Re: Request for Feedback On Test Harness

From: James Graham <jgraham@opera.com>
Date: Mon, 06 Dec 2010 14:02:36 +0100
Message-ID: <4CFCDEEC.5000501@opera.com>
To: Maciej Stachowiak <mjs@apple.com>
CC: "'public-html-testsuite@w3.org'" <public-html-testsuite@w3.org>
On 12/01/2010 12:54 PM, James Graham wrote:

> So an API improvement to make writing the kind of test in your example
> easier would be satisfactory? Rather than making specific API for the
> run-a-test-with-a-single-assert-and-no-other-code case, a possibility
> would be to have a generate_tests() function. You would pass this a
> function, and an array containing parameters to pass to the function
> call e.g.
>
> generate_tests(assert_equals, [
> [1+1,2],
> [2+3,5]])
>
> This would generalize better since one could pass in a custom written
> function that did more than a simple assert_*

FWIW I made a simple implementation of this and used it to write some 
tests that did indeed have more to them than a simple assert_ but could 
be (trivially) factored into a form where they differed only in the 
input parameters to a function. It seemed pretty usable to me, but I may 
not be the best judge of code/api aesthetics.
Received on Monday, 6 December 2010 13:03:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 December 2010 13:03:17 GMT