aboutsummaryrefslogtreecommitdiff
path: root/tests/lib.rs
blob: d236f4909f1910447e1f884dc04635ce9f23d2d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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);
 * } */