diff --git a/include/mapbox/geometry/feature.hpp b/include/mapbox/geometry/feature.hpp index 2294353..ffdf353 100644 --- a/include/mapbox/geometry/feature.hpp +++ b/include/mapbox/geometry/feature.hpp @@ -13,7 +13,7 @@ namespace mapbox { namespace geometry { struct value; -using value_base = mapbox::util::variant>, mapbox::util::recursive_wrapper>>; diff --git a/tests/test.cpp b/tests/test.cpp index 8d649ec..d27471d 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -105,6 +105,30 @@ static void testFeature() { feature pf { point() }; assert(pf.geometry.is>()); assert(pf.properties.size() == 0); + + auto &p = pf.properties; + + p["bool"] = true; + p["string"] = std::string("foo"); + p["double"] = 2.5; + p["uint"] = uint64_t(10); + p["int"] = int64_t(-10); + p["null"] = nullptr; + + assert(p["bool"].is()); + assert(p["bool"] == true); + assert(p["string"].is()); + assert(p["string"] == std::string("foo")); + assert(p["double"].is()); + assert(p["double"] == 2.5); + assert(p["uint"].is()); + assert(p["uint"] == uint64_t(10)); + assert(p["int"].is()); + assert(p["int"] == int64_t(-10)); + assert(p["null"].is()); + assert(p["null"] == nullptr); + + assert(p.size() == 6); } static void testFeatureCollection() {