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
#![allow(dead_code)]
#![feature(proc_macro)] // Rust nightly
#![feature(test)]

extern crate test;
#[macro_use]
extern crate serde_derive;
extern crate serde_bytes;
extern crate rustc_serialize;

mod torrent;

pub use torrent::{Torrent};

#[cfg(test)]
mod tests {
    use super::*;
    use test::Bencher;

    #[test]
    fn test1() -> () {
        Torrent::from_file("screen.torrent").unwrap();
        ()
    }

    #[bench]
    fn bench_test1(b: &mut Bencher) {
        b.iter(|| {
            Torrent::from_file("screen.torrent").unwrap()
        });
    }
}