aboutsummaryrefslogtreecommitdiff
path: root/tests/prefix-map
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-01-19 09:06:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-01-19 09:06:39 +0200
commit3053f55528dbecb08ddb55fa94546a98af06e3e1 (patch)
tree6f9dc9fb9fe6c5593f1304f884d5c49c89bcad0b /tests/prefix-map
parent89bc63fb386f0e4d6e2b21c0d806da1e8de0a34d (diff)
Reimplement prefix_map::find_sup() to iterate over key, not entries
Diffstat (limited to 'tests/prefix-map')
-rw-r--r--tests/prefix-map/driver.cxx12
1 files changed, 12 insertions, 0 deletions
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);
+ }
}