diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-19 09:06:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-19 09:06:39 +0200 |
commit | 3053f55528dbecb08ddb55fa94546a98af06e3e1 (patch) | |
tree | 6f9dc9fb9fe6c5593f1304f884d5c49c89bcad0b /tests/prefix-map/driver.cxx | |
parent | 89bc63fb386f0e4d6e2b21c0d806da1e8de0a34d (diff) |
Reimplement prefix_map::find_sup() to iterate over key, not entries
Diffstat (limited to 'tests/prefix-map/driver.cxx')
-rw-r--r-- | tests/prefix-map/driver.cxx | 12 |
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); + } } |