Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Nov 28, 2013
1 parent be660c0 commit 6843331
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 133 deletions.
129 changes: 0 additions & 129 deletions geohash.js

This file was deleted.

7 changes: 3 additions & 4 deletions test/test.js
Expand Up @@ -6,13 +6,12 @@ describe('geohasher', function () {
assert.equal(GeoHasher.encode(37.8324, 112.5584), 'ww8p1r4t8yd0', 'should be equal ww8p1r4t8yd0');
assert.equal(GeoHasher.encode(37.8324, 112.5584, 9), 'ww8p1r4t8', 'should be equal ww8p1r4t8');
assert.equal(GeoHasher.encode(-25.382708, -49.265506), '6gkzwgjzn820', 'should be equal 6gkzwgjzn820');
assert.equal(GeoHasher.encode(57.64911,10.40744), 'u4pruydqqvj8', 'should be equal u4pruydqqvj8');
assert.equal(GeoHasher.encode(57.64911, 10.40744), 'u4pruydqqvj8', 'should be equal u4pruydqqvj8');
});

it('decode', function () {
var result1 = GeoHasher.decode('ww8p1r4t8yd0');
console.log(result1);
assert.equal(result1.latitude, 37.8324, 'should be equal 37.8324');
assert.equal(result1.longitude, 112.5584, 'should be equal 112.5584');
assert.equal(result1.latitude[0].toFixed(4), 37.8324, 'should be equal 37.8324');
assert.equal(result1.longitude[0].toFixed(4), 112.5584, 'should be equal 112.5584');
});
});

0 comments on commit 6843331

Please sign in to comment.