diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-18 12:25:02 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-06-18 12:25:02 +0200 |
commit | 4cda4b89c16932f02e04c5019a71b659ccf821e6 (patch) | |
tree | 8fbaddb1c64a53c9c871c1a96a99ec64490d222a /tests/build/prefix-map | |
parent | 5cb5b09b198932a0d3bd985fd52fd9fbcb1c2af5 (diff) |
Move prefix-map from build2 to libbutl
Diffstat (limited to 'tests/build/prefix-map')
-rw-r--r-- | tests/build/prefix-map/buildfile | 1 | ||||
-rw-r--r-- | tests/build/prefix-map/driver.cxx | 153 |
2 files changed, 0 insertions, 154 deletions
diff --git a/tests/build/prefix-map/buildfile b/tests/build/prefix-map/buildfile deleted file mode 100644 index a72d02f..0000000 --- a/tests/build/prefix-map/buildfile +++ /dev/null @@ -1 +0,0 @@ -exe{driver}: cxx{driver} diff --git a/tests/build/prefix-map/driver.cxx b/tests/build/prefix-map/driver.cxx deleted file mode 100644 index bbbd472..0000000 --- a/tests/build/prefix-map/driver.cxx +++ /dev/null @@ -1,153 +0,0 @@ -// file : tests/build/prefix-map/driver.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include <string> -#include <cassert> -#include <iostream> - -#include <build/prefix-map> - -using namespace std; -using namespace build; - -int -main () -{ - typedef prefix_map<string, int, '.'> pm; - - { - const pm m; - - { - auto r (m.find_prefix ("")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("foo")); - assert (r.first == r.second); - } - } - - { - pm m {{{"foo", 1}}}; - - { - auto r (m.find_prefix ("")); - assert (r.first != r.second && r.first->second == 1 && - ++r.first == r.second); - } - - { - auto r (m.find_prefix ("fo")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("fox")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("fooo")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("foo.bar")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("foo")); - assert (r.first != r.second && r.first->second == 1 && - ++r.first == r.second); - } - } - - { - pm m {{{"foo", 1}, {"bar", 2}}}; - - { - auto r (m.find_prefix ("")); - assert (r.first != r.second && r.first->second == 2 && - ++r.first != r.second && r.first->second == 1 && - ++r.first == r.second); - } - - { - auto r (m.find_prefix ("fo")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("fox")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("fooo")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("foo.bar")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("foo")); - assert (r.first != r.second && r.first->second == 1 && - ++r.first == r.second); - } - - { - auto r (m.find_prefix ("bar")); - assert (r.first != r.second && r.first->second == 2 && - ++r.first == r.second); - } - } - - { - pm m ( - {{"boo", 1}, - {"foo", 2}, {"fooa", 3}, {"foo.bar", 4}, {"foo.fox", 5}, - {"xoo", 5}}); - - { - auto r (m.find_prefix ("fo")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("fox")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("fooo")); - assert (r.first == r.second); - } - - { - auto r (m.find_prefix ("foo.bar")); - assert (r.first != r.second && r.first->second == 4 && - ++r.first == r.second); - } - - { - auto r (m.find_prefix ("foo.fox")); - assert (r.first != r.second && r.first->second == 5 && - ++r.first == r.second); - } - - { - auto r (m.find_prefix ("foo")); - assert (r.first != r.second && r.first->second == 2 && - ++r.first != r.second && r.first->second == 4 && - ++r.first != r.second && r.first->second == 5 && - ++r.first == r.second); - } - } -} |