diff options
author | John Resig <jeresig@gmail.com> | 2010-09-21 00:38:26 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-09-21 00:38:26 -0400 |
commit | d5d4e4df65b56319b4f1216f63008a9751690315 (patch) | |
tree | 7b38eb67a66668155b354cd573641283763474db /test/unit/data.js | |
parent | 4a46f3d7fbbaa0b7dab49ac815ccec78f1c45d2b (diff) | |
download | jquery-d5d4e4df65b56319b4f1216f63008a9751690315.tar.gz jquery-d5d4e4df65b56319b4f1216f63008a9751690315.zip |
Tweaked the data number RegExp some to handle some other edge cases.
Diffstat (limited to 'test/unit/data.js')
-rw-r--r-- | test/unit/data.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index 9d43cb59a..68e24b63d 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(20); + expect(22); var div = jQuery("<div>"), child = jQuery("<div data-myobj='old data' data-ignored=\"DOM\"></div>"); @@ -184,6 +184,8 @@ test("data-* attributes", function() { .attr("data-false", "false") .attr("data-five", "5") .attr("data-point", "5.5") + .attr("data-pointbad", "5..5") + .attr("data-pointbad2", "-.") .attr("data-null", "null") .attr("data-string", "test"); @@ -191,6 +193,8 @@ test("data-* attributes", function() { 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('null'), null, "Primitive null read from attribute"); equals( child.data('string'), "test", "Typical string read from attribute"); |