diff options
author | jeresig <jeresig@gmail.com> | 2010-09-21 08:30:12 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-09-21 08:30:12 -0400 |
commit | e0b24306a86629f02576017f25d295fbe07f21a5 (patch) | |
tree | 5bd6db483bd54c142d4d2397b86113638068a224 /test/unit/data.js | |
parent | 1f8a5e4bbc49c244051101765c46bd8f35e2aa32 (diff) | |
download | jquery-e0b24306a86629f02576017f25d295fbe07f21a5.tar.gz jquery-e0b24306a86629f02576017f25d295fbe07f21a5.zip |
Handle some additional data- number edge cases.
Diffstat (limited to 'test/unit/data.js')
-rw-r--r-- | test/unit/data.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index f87d7ae4f..058f23f40 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -158,7 +158,7 @@ test(".data(String) and .data(String, Object)", function() { }); test("data-* attributes", function() { - expect(24); + expect(25); var div = jQuery("<div>"), child = jQuery("<div data-myobj='old data' data-ignored=\"DOM\"></div>"); @@ -184,6 +184,7 @@ test("data-* attributes", function() { .attr("data-false", "false") .attr("data-five", "5") .attr("data-point", "5.5") + .attr("data-pointe", "5.5E3") .attr("data-pointbad", "5..5") .attr("data-pointbad2", "-.") .attr("data-badjson", "{123}") @@ -191,16 +192,17 @@ test("data-* attributes", function() { .attr("data-null", "null") .attr("data-string", "test"); - equals( child.data('true'), true, "Primitive true read from attribute"); - equals( child.data('false'), false, "Primitive false read from attribute"); - equals( child.data('five'), 5, "Primitive number read from attribute"); - equals( child.data('point'), 5.5, "Primitive number read from attribute"); - 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"); + strictEqual( child.data('true'), true, "Primitive true read from attribute"); + strictEqual( child.data('false'), false, "Primitive false read from attribute"); + strictEqual( child.data('five'), 5, "Primitive number read from attribute"); + strictEqual( child.data('point'), 5.5, "Primitive number read from attribute"); + strictEqual( child.data('pointe'), 5500, "Primitive number read from attribute"); + strictEqual( child.data('pointbad'), "5..5", "Bad number read from attribute"); + strictEqual( child.data('pointbad2'), "-.", "Bad number read from attribute"); + strictEqual( child.data('badjson'), "{123}", "Bad number read from attribute"); + strictEqual( child.data('badjson2'), "[abc]", "Bad number read from attribute"); + strictEqual( child.data('null'), null, "Primitive null read from attribute"); + strictEqual( child.data('string'), "test", "Typical string read from attribute"); child.remove(); |