diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-28 22:41:09 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-28 22:41:09 +0000 |
| commit | 75aa6e480d998b29205c0eab328697a5d007986b (patch) | |
| tree | ac53060d67ac2f6c64994e405220977c5ae5d817 /test/test.cc | |
| parent | 7f20aa518356f188946eb508239caf7c113da819 (diff) | |
Basic writer.
Diffstat (limited to 'test/test.cc')
| -rw-r--r-- | test/test.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test.cc b/test/test.cc index eb6eecf..3556fa5 100644 --- a/test/test.cc +++ b/test/test.cc @@ -20,3 +20,27 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE libsub_test #include <boost/test/unit_test.hpp> +#include <fstream> +#include <string> + +using std::string; +using std::ifstream; +using std::getline; + +void +check_text (string a, string b) +{ + ifstream p (a.c_str ()); + ifstream q (b.c_str ()); + + string x; + string y; + while (p.good() && q.good()) { + getline (p, x); + getline (q, y); + BOOST_CHECK_EQUAL (x, y); + } + + BOOST_CHECK (p.good() == false); + BOOST_CHECK (q.good() == false); +} |
