aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-07 14:35:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-07 14:35:17 +0000
commitbdcf5c47f4ed256e38eda6aa2c652681f1c45e61 (patch)
tree003dc5cc4059f18a396e4db6b0eab73a185a967e
parent2d6aff791cebf7b5e7a00f32d47951e85027be32 (diff)
downloadpaludis-bdcf5c47f4ed256e38eda6aa2c652681f1c45e61.tar.gz
paludis-bdcf5c47f4ed256e38eda6aa2c652681f1c45e61.tar.xz
More tests
-rw-r--r--paludis/util/pstream_TEST.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/paludis/util/pstream_TEST.cc b/paludis/util/pstream_TEST.cc
index 517d3eb..5500f11 100644
--- a/paludis/util/pstream_TEST.cc
+++ b/paludis/util/pstream_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -102,5 +102,21 @@ namespace test_cases
delete p;
}
} test_pstream_fail;
+
+ struct PStreamParallelTest : TestCase
+ {
+ PStreamParallelTest() : TestCase("pstream parallel") { }
+
+ void run()
+ {
+ PStream one("echo one ; sleep 3 ; echo one"),
+ two("echo two ; sleep 2 ; echo two "),
+ three("echo three ; sleep 1 ; echo three");
+
+ TEST_CHECK_EQUAL(std::string((std::istreambuf_iterator<char>(three)), std::istreambuf_iterator<char>()), "three\nthree\n");
+ TEST_CHECK_EQUAL(std::string((std::istreambuf_iterator<char>(one)), std::istreambuf_iterator<char>()), "one\none\n");
+ TEST_CHECK_EQUAL(std::string((std::istreambuf_iterator<char>(two)), std::istreambuf_iterator<char>()), "two\ntwo\n");
+ }
+ } test_pstream_parallel;
}