Fix tests to run on stable

Signed-off-by: trivernis <trivernis@protonmail.com>
master
trivernis 4 years ago
parent 463f2ffee1
commit bca9220cab
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,6 +1,6 @@
[package] [package]
name = "charred" name = "charred"
version = "0.3.1" version = "0.3.3"
authors = ["trivernis <trivernis@protonmail.com>"] authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018" edition = "2018"
license-file = "LICENSE" license-file = "LICENSE"

@ -1,12 +1,9 @@
#![feature(test)]
extern crate test;
pub mod tapemachine; pub mod tapemachine;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::tapemachine::TapeResult; use crate::tapemachine::TapeResult;
use crate::tapemachine::{CharTapeMachine, TapeError}; use crate::tapemachine::{CharTapeMachine, TapeError};
use test::Bencher;
const TEST_STRING: &str = "TEST STRING 1234 \\l \\n"; const TEST_STRING: &str = "TEST STRING 1234 \\l \\n";
@ -82,24 +79,4 @@ mod tests {
Ok(()) Ok(())
} }
#[bench]
fn bench_assert_seek(b: &mut Bencher) {
let mut ctm = CharTapeMachine::new(TEST_STRING.chars().collect());
b.iter(|| {
ctm.check_char(&'T');
ctm.seek_one().unwrap();
ctm.check_char(&'E');
ctm.seek_one().unwrap();
ctm.check_char(&'F');
ctm.seek_one().unwrap();
ctm.check_any(&['A', 'B', 'C', 'D', 'E', '2']);
ctm.seek_one().unwrap();
ctm.seek_whitespace();
ctm.check_sequence(&['S', 'T', 'R', 'I', 'N', 'T']);
ctm.check_sequence(&['S', 'T', 'R', 'I', 'N', 'G']);
ctm.check_eof();
ctm.rewind(0);
})
}
} }

Loading…
Cancel
Save