UNPKG

numbers2words

Version:
36 lines (35 loc) 1.38 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://code.jquery.com/jquery-latest.js"></script> <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.12.0.css" type="text/css" media="screen" /> <script type="text/javascript" src="http://code.jquery.com/qunit/qunit-1.12.0.js"></script> <script type="text/javascript" src="../src/polyfill/polyfill.js"></script> <script type="text/javascript" src="../src/numbers2words.js"></script> <script type="text/javascript" src="../src/locales/cs_CZ.js"></script> <script> window.onload = function( ) { test( "tokenize", function( ) { var translator = new T2W("CS_CZ"); equal( translator.tokenize(123, 3).length, 1); equal( translator.tokenize(123456, 2 ).length, 3); equal( translator.tokenize(123456789, 1).length, 9); equal( translator.tokenize(1234567891, 3).length, 4); deepEqual( translator.tokenize(123456789, 1), [9,8,7,6,5,4,3,2,1]); deepEqual( translator.tokenize(123456789, 3), [789,456,123]); }); };// onload </script> </head> <body> <h1 id="qunit-header">T2W core</h1> <h2 id="qunit-banner"></h2> <div id="qunit-testrunner-toolbar"></div> <h2 id="qunit-userAgent"></h2> <ol id="qunit-tests"></ol> <div id="qunit-fixture"> test markup, will be hidden </div> </body> </html>