aboutsummaryrefslogtreecommitdiff
path: root/tests/build/prefix_map/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-23 16:16:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-23 16:16:23 +0200
commitdea0d0913711f23fff3b902e3aa6006c6b54905a (patch)
tree3d1c3802af8bf68566e02683347f4251fa6d603e /tests/build/prefix_map/driver.cxx
parente5fedf8a485d7b1b7d26e08557ca40c863d3255b (diff)
Clean up file names
Diffstat (limited to 'tests/build/prefix_map/driver.cxx')
-rw-r--r--tests/build/prefix_map/driver.cxx156
1 files changed, 0 insertions, 156 deletions
diff --git a/tests/build/prefix_map/driver.cxx b/tests/build/prefix_map/driver.cxx
deleted file mode 100644
index ba9478c..0000000
--- a/tests/build/prefix_map/driver.cxx
+++ /dev/null
@@ -1,156 +0,0 @@
-// file : tests/build/prefix_map/driver.cxx -*- C++ -*-
-// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
-// 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 (""));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("foo"));
- assert (r.first == r.second);
- }
- }
-
- {
- pm m {{{"foo", 1}}, '.'};
-
- {
- auto r (m.find (""));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fo"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fox"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fooo"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("foo.bar"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("foo"));
- assert (r.first != r.second && r.first->second == 1 &&
- ++r.first == r.second);
- }
- }
-
- {
- pm m {{{"foo", 1}, {"bar", 2}}, '.'};
-
- {
- auto r (m.find (""));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fo"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fox"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fooo"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("foo.bar"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("foo"));
- assert (r.first != r.second && r.first->second == 1 &&
- ++r.first == r.second);
- }
-
- {
- auto r (m.find ("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 (""));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fo"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fox"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("fooo"));
- assert (r.first == r.second);
- }
-
- {
- auto r (m.find ("foo.bar"));
- assert (r.first != r.second && r.first->second == 4 &&
- ++r.first == r.second);
- }
-
- {
- auto r (m.find ("foo.fox"));
- assert (r.first != r.second && r.first->second == 5 &&
- ++r.first == r.second);
- }
-
- {
- auto r (m.find ("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);
- }
- }
-}