From 3053f55528dbecb08ddb55fa94546a98af06e3e1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 19 Jan 2018 09:06:39 +0200 Subject: Reimplement prefix_map::find_sup() to iterate over key, not entries --- tests/prefix-map/driver.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/prefix-map/driver.cxx b/tests/prefix-map/driver.cxx index 2fb8a99..70afc30 100644 --- a/tests/prefix-map/driver.cxx +++ b/tests/prefix-map/driver.cxx @@ -201,4 +201,16 @@ main () assert (i != e && i->second == 7); } } + + { + // Test the special empty prefix logic. + // + pm m ({{"", 1}}); + + auto e (m.end ()); + + assert (m.find_sup ("") != e); + assert (m.find_sup ("foo") != e); + assert (m.find_sup ("foo.bar") != e); + } } -- cgit v1.1