summaryrefslogtreecommitdiff
path: root/tests/textual.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-08-21 02:39:33 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:32 -0400
commitdb0ef2e25731a824aa728315f2f7f6e8a41a5ddf (patch)
tree073a4ffe44699413d97e56bae001e2f69a8b9a04 /tests/textual.h
parentbec5f1c07af7948eb26a7cbafc6d191cfbb77d97 (diff)
downloadfork-ledger-db0ef2e25731a824aa728315f2f7f6e8a41a5ddf.tar.gz
fork-ledger-db0ef2e25731a824aa728315f2f7f6e8a41a5ddf.tar.bz2
fork-ledger-db0ef2e25731a824aa728315f2f7f6e8a41a5ddf.zip
*** empty log message ***
Diffstat (limited to 'tests/textual.h')
-rw-r--r--tests/textual.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/textual.h b/tests/textual.h
new file mode 100644
index 00000000..adf24c77
--- /dev/null
+++ b/tests/textual.h
@@ -0,0 +1,34 @@
+#ifndef __TESTTEXTUALJOURNAL_H
+#define __TESTTEXTUALJOURNAL_H
+
+#include <cxxtest/TestSuite.h>
+
+#include <textual.h>
+#include <config.h>
+
+using namespace std;
+using namespace ledger;
+
+class TestTextualJournal : public CxxTest::TestSuite
+{
+public:
+ void testEmptyFileIsTextualFile()
+ {
+ stringstream j(stringstream::in);
+
+ j << "2005/10/15 Something" << endl;
+ j << " A $ 42" << endl;
+ j << " B" << endl;
+
+ textual_parser_t textualParser;
+ TS_ASSERT(textualParser.test(j));
+ TS_ASSERT(j.good());
+ TS_ASSERT_EQUALS(0, j.tellg());
+
+ config_t config;
+ std::auto_ptr<journal_t> journal(new journal_t);
+ textualParser.parse(j, config, journal.get());
+ }
+};
+
+#endif // __TESTTEXTUALJOURNAL_H