Skip to content

Commit

Permalink
expresso test
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed Mar 15, 2011
1 parent 46879aa commit 9fb5cff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/render_grid.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var mapnik = require('../lib');
var assert = require('assert');
var fs = require('fs');
var util = require('util');

exports['test grid rendering'] = function(beforeExit) {
var rendered = false;
var reference = fs.readFileSync('./test/support/simple_grid.json', 'utf8');

var map_grid = new mapnik.Map(256, 256);
map_grid.load('./examples/stylesheet.xml');
map_grid.zoom_all();

map_grid._render_grid(0, 4, 'FIPS', function(err, grid) {
rendered = true;
assert.ok(!err);
assert.equal(JSON.stringify(grid), reference);
});

beforeExit(function() {
assert.ok(rendered);
});
};
1 change: 1 addition & 0 deletions test/support/simple_grid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"grid":"[\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" !!!! \",\" #### !!!!! \",\" #####!!!!!!!! \",\" #####!!!!!!!!!! $$$ $$ \",\" ######!!!!!!!!!! %% $$$$$ $ $$ \",\" #######!!!!!!!!! %%%%% $$$ $ $$$ \",\" ########!!!!!!!!!! %%%% $$$$ \",\" #########!!!!!!!!!! %%% $ $$$$$ \",\" #########!!!!!!!!!! % % $$$ $$$$$$$ $$$$ \",\" ######### !!!!!!!! % $$ $$$$$$$ $$$ \",\" ########## !!!!!!!! $$ $$$$$$$$$$$ $$ \",\"$ && ########### !!!!!!! % ''' $$$$$$$$$$$$$$$$$$$$ $\",\" &&&&&############## !!!!!!! '('$$ $$$$$$$$$$$$$$$$$$$$$$$$\",\" &&&&&###############!!!!!! ((($$$$$$$$$$$$$$$$$$$$$$$$$$$\",\" $&&&&&###############!!!! ))) '((($$$$$$$$$$$$$$$$$$$$$$$$$$$\",\" &&&&&&############## !!! )))* ''((+$$$$$$$$$$$$$$$$$$$$$$$$$$$\",\" &&&&&&&&####### #### !! ,'((($$$$$$$$$$$$$$$$$$$$$$$$$$$ \",\" && &&############# ,,'((($$$$$$$$$$$$$$$$$$$$$$ $$$ \",\" &&& &############## ,,,-($.$$$$$$$$$$$$$$$$$$$$$ $$$& \",\"& ############## ,,,-../$$$$$$00$$$$$$$$$$$$$ $$ &&\",\" &&&&&&&&&#&### 11234//$$$05000066666667$$$$ \",\" &&&&&&&&&&&& 8889944/$$$5555007666667:$$$$ \",\" &&&&&&&&&&& 888;9<====>?555@77777777A BB \",\" &&&&&&&&& C 88D;EFF==GH>??IIJ7777777ABB \",\" K&&&&&& 8LLMD;FFFNOOO>IIIIPPJJ7777BB \",\" & KKK& &Q LLLRDSSFFTOOOUIIIJJPJ7V7WXB \",\" && KKKKQYZ[ ]LLR^SSSFTTT___` JJJJabVV7c \",\" KKddef g ]hhRiijjTTTT___ JJJ JbVV cc \",\" dkllllm nniijjoTTTppp JJ JbVVccc q \",\" rrlllms tujvwoTxxpp yyyyyyy \",\" r zzzssssss {ww||x}} yyyyyyyyy~~ \",\" zzzssssss |||}} yyyy€yyy~~ ‚\",\"ƒ„ zzssssss …†}‡ˆ ‰‰‰‰‰ Š ‹\",\"ŒŒ  zŽŽsss ††ˆˆ‘ ‰‰‰‰‰‰‰ ŠŠ‹\",\" ’ŽŽŽss “†‡ˆˆ ‰‰‰‰‰‰‰‰ ” \",\" ’ ’•––s —˜ ‰‰‰‰‰‰‰‰ \",\" ’’•–– ™™™ ‰‰‰‰‰‰‰‰ šš\",\" ’’•• ‰‰‰ šš\",\"š ’’• ‰‰ ššš\",\" ’’• ™ ›› šš \",\" ’’ œ › š \",\" ’’’  ž š \",\" ’  \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \"]","keys":["","GL","CA","RS","SV","US","NO","SW","IC","FO","FI","UK","NL","PL","UP","KZ","FR","SZ","SI","RB","UZ","MG","CH","SP","IT","KN","TS","MK","TU","IR","TX","TI","KS","JA","PO","AG","MT","LY","SY","IZ","PK","IN","MX","WI","MO","EG","SA","NP","CU","MR","NG","SU","AE","VM","HK","TW","JM","HA","RQ","CV","ML","YM","MU","BM","TH","RP","NU","CO","NT","GP","SG","UV","NI","PM","VE","NS","SL","CT","SO","RM","EC","BR","LI","IV","TP","GB","UG","ID","PE","EK","CG","TZ","PP","ZA","TT","BP","TV","WF","WS","AO","ZI","MZ","MA","AS","NH","FJ","TN","FP","PA","WA","MI","RE","CI","BC","NC","AR","UY","LT","WZ","SF","NZ","FS","FK","SX","HM"],"data":{}}

0 comments on commit 9fb5cff

Please sign in to comment.