OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>print_preview_utils.js tests</title> | 4 <title>print_preview_utils.js tests</title> |
5 <script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.j s"></script> | 5 <script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.j s"></script> |
6 <script src="print_preview_utils.js"></script> | 6 <script src="print_preview_utils.js"></script> |
7 <script> | 7 <script> |
8 goog.require('goog.testing.jsunit'); | 8 goog.require('goog.testing.jsunit'); |
9 </script> | 9 </script> |
10 </head> | 10 </head> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 | 107 |
108 function testConvertInchesToPoints() { | 108 function testConvertInchesToPoints() { |
109 assertEquals(convertInchesToPoints(1), 72); | 109 assertEquals(convertInchesToPoints(1), 72); |
110 assertEquals(convertInchesToPoints(2), 144); | 110 assertEquals(convertInchesToPoints(2), 144); |
111 assertEquals(convertInchesToPoints(0.45), 32.4); | 111 assertEquals(convertInchesToPoints(0.45), 32.4); |
112 } | 112 } |
113 | 113 |
114 function testConvertPointsToInches() { | 114 function testConvertPointsToInches() { |
115 assertEquals(convertPointsToInches(72), 1); | 115 assertEquals(convertPointsToInches(72), 1); |
116 assertEquals(convertPointsToInches(144), 2); | 116 assertEquals(convertPointsToInches(144), 2); |
117 assertEquals(convertPointsToInches(32.4), 0.45); | 117 assertEquals(convertPointsToInches(36), 0.5); |
118 } | |
119 | |
120 function testConvertMillimetersToPoints() { | |
121 assertEquals(convertMillimetersToPoints(10), 28.3464567); | |
Evan Stade
2011/10/22 00:30:45
I don't think these tests are super useful, you ar
dpapad
2011/10/22 00:47:29
I agree. Basically these tests only cover the case
| |
122 assertEquals(convertMillimetersToPoints(20), 56.6929134); | |
123 assertEquals(convertMillimetersToPoints(4.5), 12.755905515); | |
124 } | |
125 | |
126 function testConvertPointsToMillimeters() { | |
127 assertEquals(convertPointsToMillimeters(73.70078742), 26); | |
128 assertEquals(convertPointsToMillimeters(34.01574804), 12); | |
129 assertEquals(convertPointsToMillimeters(144.56692917), 51); | |
118 } | 130 } |
119 | 131 |
120 </script> | 132 </script> |
121 </body> | 133 </body> |
122 </html> | 134 </html> |
OLD | NEW |