| | |
| | | <script type='text/javascript' src='../editor/src/browser.js'></script> |
| | | <script type='text/javascript' src='../editor/src/svgtransformlist.js'></script> |
| | | <script type='text/javascript' src='../editor/src/svgutils.js'></script> |
| | | <script type='text/javascript' src='qunit/qunit.js'></script> |
| | | <script type='text/javascript' src='qunit/qunit.js'></script> |
| | | <script type='text/javascript'> |
| | | $(function() { |
| | | // log function |
| | |
| | | |
| | | test('Test svgedit.utilities package', function() { |
| | | expect(3); |
| | | |
| | | |
| | | ok(svgedit.utilities); |
| | | ok(svgedit.utilities.toXml); |
| | | equals(typeof svgedit.utilities.toXml, typeof function(){}); |
| | |
| | | test('Test svgedit.utilities.toXml() function', function() { |
| | | expect(6); |
| | | var toXml = svgedit.utilities.toXml; |
| | | |
| | | |
| | | equals(toXml('a'), 'a'); |
| | | equals(toXml('ABC_'), 'ABC_'); |
| | | equals(toXml('PB&J'), 'PB&J'); |
| | |
| | | |
| | | test('Test svgedit.utilities.convertToXMLReferences() function', function() { |
| | | expect(1); |
| | | |
| | | |
| | | var convert = svgedit.utilities.convertToXMLReferences; |
| | | equals(convert('ABC'), 'ABC'); |
| | | // equals(convert('ÀBC'), 'ÀBC'); |
| | |
| | | rect.y = 2; |
| | | rect.width = 3; |
| | | rect.height = 4; |
| | | |
| | | |
| | | var obj = bboxToObj(rect); |
| | | equals(typeof obj, typeof {}); |
| | | equals(obj.x, 1); |
| | |
| | | equals(obj.height, 4); |
| | | }); |
| | | |
| | | |
| | | |
| | | test("Test getUrlFromAttr", function() { |
| | | expect(4); |
| | | |
| | | |
| | | equal(svgedit.utilities.getUrlFromAttr("url(#foo)"), "#foo"); |
| | | equal(svgedit.utilities.getUrlFromAttr("url(somefile.svg#foo)"), "somefile.svg#foo"); |
| | | equal(svgedit.utilities.getUrlFromAttr("url('#foo')"), "#foo"); |
| | |
| | | ok(bb.y && !isNaN(bb.y)); |
| | | }); |
| | | |
| | | }); |
| | | </script> |
| | | </head> |
| | | <body> |
| | | }); |
| | | </script> |
| | | </head> |
| | | <body> |
| | | <h1 id='qunit-header'>Unit Tests for svgutils.js</h1> |
| | | <h2 id='qunit-banner'></h2> |
| | | <h2 id='qunit-userAgent'></h2> |
| | | <ol id='qunit-tests'> |
| | | </ol> |
| | | </body> |
| | | </body> |
| | | </html> |