aboutsummaryrefslogtreecommitdiff
path: root/tests/lib.rs
diff options
context:
space:
mode:
authorTill Höppner2016-03-02 12:57:36 +0100
committerTill Höppner2016-03-02 12:57:36 +0100
commita4db0628a0377b39be02f0e83832b0c3527933e1 (patch)
tree375e33b2942b6374e352b554d7202664812ddf2f /tests/lib.rs
parent52d4c29f5bce85abadeb9fd394f55caf488b37f3 (diff)
downloadilc-0.3.0.tar.gz
ilc-0.3.0.tar.xz
ilc-0.3.0.zip
Merging of any number of logsv0.3.0v0.3
Diffstat (limited to 'tests/lib.rs')
-rw-r--r--tests/lib.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/lib.rs b/tests/lib.rs
new file mode 100644
index 0000000..d236f49
--- /dev/null
+++ b/tests/lib.rs
@@ -0,0 +1,46 @@
+extern crate ilc;
+
+use std::default::Default;
+use std::io::Cursor;
+
+use ilc::*;
+
+mod files;
+
+#[test]
+fn identity() {
+ let original = files::read("2016-02-26.log");
+ let mut output = Vec::new();
+
+ convert(&Context::default(),
+ &mut (&original as &[u8]),
+ &mut Energymech,
+ &mut output,
+ &Energymech)
+ .expect("Conversion failed");
+
+ files::write("identity.out", &output);
+
+ // don't assert_eq!, as the failed ouput doesn't help anyone
+ assert!(&original == &output);
+}
+
+/* #[test]
+ * fn merge() {
+ * let part1 = Cursor::new(files::read("2016-02-26.log.1"));
+ * let part2 = Cursor::new(files::read("2016-02-26.log.2"));
+ *
+ * let mut output = Vec::new();
+ *
+ * merge(&Context::default(),
+ * vec![&mut part1, &mut part2],
+ * &mut Energymech,
+ * &mut output,
+ * &Energymech)
+ * .expect("Merge failed");
+ *
+ * files::write("merged.out", &output);
+ *
+ * let original = files::read("2016-02-26.log");
+ * assert!(&original == &output);
+ * } */