summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-03-06 15:33:14 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-03-06 15:33:14 -0800
commitcd83c48ed3226114c0a9f20628816966408cd9d4 (patch)
tree09a50a0c428e9b221ba12b29ea683448e26981e3 /test
parentde591b5d7ca365030cfd8582db488395ebcae20e (diff)
downloadqtlocation-mapboxgl-cd83c48ed3226114c0a9f20628816966408cd9d4.tar.gz
Insert {ratio} before extension, not inside access token
Fixes #959.
Diffstat (limited to 'test')
-rw-r--r--test/miscellaneous/mapbox.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/miscellaneous/mapbox.cpp b/test/miscellaneous/mapbox.cpp
index e82478874b..9496f2d270 100644
--- a/test/miscellaneous/mapbox.cpp
+++ b/test/miscellaneous/mapbox.cpp
@@ -28,6 +28,10 @@ TEST(Mapbox, TileURL) {
EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.png", "mapbox://user.map", SourceType::Vector), "http://path.png/tile.png");
EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.pbf", "mapbox://user.map", SourceType::Raster), "http://path.png/tile{ratio}.pbf");
EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.pbf", "mapbox://user.map", SourceType::Vector), "http://path.png/tile.pbf");
+ EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.pbf?access_token=foo", "mapbox://user.map", SourceType::Raster), "http://path.png/tile{ratio}.pbf?access_token=foo");
+ EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.pbf?access_token=foo.png", "mapbox://user.map", SourceType::Raster), "http://path.png/tile{ratio}.pbf?access_token=foo.png");
+ EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.pbf?access_token=foo.png/bar", "mapbox://user.map", SourceType::Raster), "http://path.png/tile{ratio}.pbf?access_token=foo.png/bar");
+ EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.pbf?access_token=foo.png/bar.png", "mapbox://user.map", SourceType::Raster), "http://path.png/tile{ratio}.pbf?access_token=foo.png/bar.png");
} catch (const std::regex_error& e) {
std::cout << "regex_error caught: " << e.what() << '\n';
std::cout << e.code() << '\n';