1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3  <head>
4<!--
5  $Id$
6  $HeadURL$
7
8  Automated tests for the NumberExtensions module
9  @author Ilya Lebedev <ilya@lebedev.net>
10-->
11   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12   <title>BrowserExtensions/NumberExtensions tests</title>
13   <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
14   <script language="JavaScript" type="text/javascript" src="jsUnitCore.js"></script>
15   <script language="JavaScript" type="text/javascript" src="../helpers.js"></script>
16   <script language="JavaScript" type="text/javascript" src="../stringextensions.js"></script>
17   <script language="JavaScript" type="text/javascript" src="../numberextensions.js"></script>
18   <script language="JavaScript" type="text/javascript" src="../regexpextensions.js"></script>
19   <script language="JavaScript" type="text/javascript">
20
21        function testRadix() {
22            assertEquals("Radix does return values 'as is' if not radix param specified", 1234, Number(1234).radix());
23            assertEquals("Radix pads number with 0s by default", "0012", Number(12).radix(10,4));
24            assertEquals("Radix pads number only on the left", "0012", Number(12).radix(10,-4));
25            assertEquals("Radix pads number with any valid symbol supplied", "   12", Number(12).radix(10,5, " "));
26            assertEquals("Radix pads number with only the first symbol from supplied string", "   12", Number(12).radix(10,5, " asdf"));
27        }
28    </script>
29</head>
30
31<body>
32<h1>Tests for the Number extensions</h1>
33
34<p>This page contains tests for the Number.prototype extension methods. To see them, take a look at the source.</p>
35</body>
36</html>
37