W3C home > Mailing lists > Public > public-html-testsuite@w3.org > February 2011

Review of dataset tests

From: Ms2ger <ms2ger@gmail.com>
Date: Sun, 27 Feb 2011 17:03:14 +0100
Message-ID: <4D6A75C2.1020203@gmail.com>
To: Sam Weinig <weinig@apple.com>
CC: "public-html-testsuite@w3.org" <public-html-testsuite@w3.org>
Hi Sam

I noticed you submitted some tests a while ago. Thanks for that! I have 
some comments:


http://dvcs.w3.org/hg/html/file/0be07106838c/tests/submission/Apple/dataset/dataset-delete.html

Generally looks good. However, the last test,

       test(function() { assert_throws("SYNTAX_ERR", function() { 
testDelete('dummy', '-foo') }); },
         "Deleting element.dataset['-foo'] should throw a SYNTAX_ERR.'");

doesn't seem to be backed by the (current) specification.

Also, it would probably be good to test that d.hasAttribute(attr) is 
false as well.


http://dvcs.w3.org/hg/html/file/0be07106838c/tests/submission/Apple/dataset/dataset-enumeration.html

This test is correct. I would, however, prefer if in

       test(function() { assert_equals(testEnumeration(['data-foo', 
'data-bar', 'dataFoo']), 2); },
         "Only attributes who qualify as dataset properties should be 
enumeratable in the dataset.");

tested ['data-foo', 'data-bar', 'dataBaz'], because an implementation 
that also looked at dataSomething would presumably still pass this test.
Also, as setAttribute lowercases its name argument, this test could 
benefit from using setAttributeNS.


http://dvcs.w3.org/hg/html/file/0be07106838c/tests/submission/Apple/dataset/dataset-get.html

As setAttributes lowercases,

       test(function() { assert_true(testGet('data-Foo', 'foo')); },
         "Getting element.dataset['foo'] should return the value of 
element.getAttribute('data-Foo')'");

is redundant. There should also be tests for data-fooBar (set with 
setAttributeNS).


http://dvcs.w3.org/hg/html/file/0be07106838c/tests/submission/Apple/dataset/dataset-instanceof.html

Approved.


http://dvcs.w3.org/hg/html/file/0be07106838c/tests/submission/Apple/dataset/dataset-set.html

Approved.


Tests for |dataset.foo| (rather than |dataset["foo"]|) and
|"foo" in dataset| would be nice too.


Thanks again
Ms2ger
Received on Sunday, 27 February 2011 16:03:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 27 February 2011 16:03:59 GMT