Unit test for svgedit.unit.isValidUnit()
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1967 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
99931f7d5b
commit
422faa53c7
|
@ -45,6 +45,27 @@
|
|||
equals(shortFloat(1.23443), 1.2344);
|
||||
equals(shortFloat(1.23455), 1.2346);
|
||||
});
|
||||
|
||||
test('Test svgedit.units.isValidUnit()', function() {
|
||||
expect(12);
|
||||
|
||||
setUp();
|
||||
|
||||
ok(svgedit.units.isValidUnit);
|
||||
equals(typeof svgedit.units.isValidUnit, typeof function(){});
|
||||
|
||||
var isValidUnit = svgedit.units.isValidUnit;
|
||||
ok(isValidUnit("0"));
|
||||
ok(isValidUnit("1"));
|
||||
ok(isValidUnit("1.1"));
|
||||
ok(isValidUnit("-1.1"));
|
||||
ok(isValidUnit(".6mm"));
|
||||
ok(isValidUnit("-.6cm"));
|
||||
ok(isValidUnit("6000in"));
|
||||
ok(isValidUnit("6px"));
|
||||
ok(isValidUnit("6.3pc"));
|
||||
ok(isValidUnit("-0.4em"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
|
Loading…
Reference in New Issue