From 410b274b6ae15c359631d018366ea38971f61ab5 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 7 Aug 2014 12:18:03 +0200 Subject: [PATCH] Add unit test for greedy template replacement --- test/spec/ol/tileurlfunction.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/spec/ol/tileurlfunction.test.js b/test/spec/ol/tileurlfunction.test.js index fe97b66dd2..c225c97a26 100644 --- a/test/spec/ol/tileurlfunction.test.js +++ b/test/spec/ol/tileurlfunction.test.js @@ -37,6 +37,10 @@ describe('ol.TileUrlFunction', function() { var tileUrl = ol.TileUrlFunction.createFromTemplate('{z}/{x}/{-y}'); expect(tileUrl(new ol.TileCoord(3, 2, 2))).to.eql('3/2/5'); }); + it('replaces multiple placeholder occurrences', function() { + var tileUrl = ol.TileUrlFunction.createFromTemplate('{z}/{z}{x}{y}'); + expect(tileUrl(new ol.TileCoord(3, 2, 1))).to.eql('3/321'); + }); }); describe('createFromTemplates', function() {