});
test("data-* attributes", function() {
- expect(23);
+ expect(24);
var div = jQuery("<div>"),
child = jQuery("<div data-myobj='old data' data-ignored=\"DOM\"></div>");
.attr("data-pointbad", "5..5")
.attr("data-pointbad2", "-.")
.attr("data-badjson", "{123}")
+ .attr("data-badjson2", "[abc]")
.attr("data-null", "null")
.attr("data-string", "test");
equals( child.data('pointbad'), "5..5", "Bad number read from attribute");
equals( child.data('pointbad2'), "-.", "Bad number read from attribute");
equals( child.data('badjson'), "{123}", "Bad number read from attribute");
+ equals( child.data('badjson2'), "[abc]", "Bad number read from attribute");
equals( child.data('null'), null, "Primitive null read from attribute");
equals( child.data('string'), "test", "Typical string read from attribute");
break;
case 3:
equals(jQuery(elem).data("number"), true, "Check number property");
- equals(jQuery(elem).data("stuff"), "[2,8]", "Check stuff property");
+ same(jQuery(elem).data("stuff"), [2,8], "Check stuff property");
break;
default:
ok(false, ["Assertion failed on index ", index, ", with data ", data].join(''));