|
22 | 22 | goog.module('openlocationcode_test');
|
23 | 23 | goog.setTestOnly('openlocationcode_test');
|
24 | 24 |
|
25 |
| -var openlocationcode = goog.require('google.openlocationcode'); |
| 25 | +var OpenLocationCode = goog.require('openlocationcode.OpenLocationCode'); |
26 | 26 | var testSuite = goog.require('goog.testing.testSuite');
|
27 | 27 | goog.require('goog.testing.asserts');
|
28 | 28 |
|
@@ -162,9 +162,9 @@ testSuite({
|
162 | 162 | for (var i = 0; i < tests.length; i++) {
|
163 | 163 | var td = tests[i];
|
164 | 164 | // Decode the code.
|
165 |
| - var ca = openlocationcode.decode(td[0]); |
| 165 | + var ca = OpenLocationCode.decode(td[0]); |
166 | 166 | // Encode the center coordinates.
|
167 |
| - var code = openlocationcode.encode(td[1], td[2], ca.codeLength); |
| 167 | + var code = OpenLocationCode.encode(td[1], td[2], ca.codeLength); |
168 | 168 | // Did we get the same code?
|
169 | 169 | assertEquals('Test ' + 1, td[0], code);
|
170 | 170 | // Check that the decode gave the correct coordinates.
|
@@ -250,9 +250,9 @@ testSuite({
|
250 | 250 | for (var i = 0; i < tests.length; i++) {
|
251 | 251 | var td = tests[i];
|
252 | 252 | // Shorten the code.
|
253 |
| - var short = openlocationcode.shorten(td[0], td[1], td[2]); |
| 253 | + var short = OpenLocationCode.shorten(td[0], td[1], td[2]); |
254 | 254 | assertEquals('Test ' + i, short, td[3]);
|
255 |
| - var recovered = openlocationcode.recoverNearest(short, td[1], td[2]); |
| 255 | + var recovered = OpenLocationCode.recoverNearest(short, td[1], td[2]); |
256 | 256 | assertEquals('Test ' + i, recovered, td[0]);
|
257 | 257 | }
|
258 | 258 | },
|
@@ -367,9 +367,9 @@ testSuite({
|
367 | 367 | ];
|
368 | 368 | for (var i = 0; i < tests.length; i++) {
|
369 | 369 | var td = tests[i];
|
370 |
| - assertEquals('Test ' + i, openlocationcode.isValid(td[0]), td[1]); |
371 |
| - assertEquals('Test ' + i, openlocationcode.isShort(td[0]), td[2]); |
372 |
| - assertEquals('Test ' + i, openlocationcode.isFull(td[0]), td[3]); |
| 370 | + assertEquals('Test ' + i, OpenLocationCode.isValid(td[0]), td[1]); |
| 371 | + assertEquals('Test ' + i, OpenLocationCode.isShort(td[0]), td[2]); |
| 372 | + assertEquals('Test ' + i, OpenLocationCode.isFull(td[0]), td[3]); |
373 | 373 | }
|
374 | 374 | },
|
375 | 375 | });
|
0 commit comments