Add missing benchmarks
This commit is contained in:
parent
ab9ba27231
commit
653b9c1d5c
|
@ -8,16 +8,16 @@ mod tests {
|
||||||
use starship::{modules, print};
|
use starship::{modules, print};
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
|
|
||||||
#[bench]
|
// #[bench]
|
||||||
fn full_prompt_bench(b: &mut Bencher) {
|
// fn full_prompt_bench(b: &mut Bencher) {
|
||||||
b.iter(|| {
|
// b.iter(|| {
|
||||||
let args = App::new("starship")
|
// let args = App::new("starship")
|
||||||
.arg(Arg::with_name("status_code"))
|
// .arg(Arg::with_name("status_code"))
|
||||||
.get_matches_from(vec!["starship", "0"]);
|
// .get_matches_from(vec!["starship", "0"]);
|
||||||
|
|
||||||
starship::print::prompt(args)
|
// starship::print::prompt(args)
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn char_section_bench(b: &mut Bencher) {
|
fn char_section_bench(b: &mut Bencher) {
|
||||||
|
@ -42,4 +42,28 @@ mod tests {
|
||||||
print::stringify_segment(segment)
|
print::stringify_segment(segment)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn line_break_section_bench(b: &mut Bencher) {
|
||||||
|
b.iter(|| {
|
||||||
|
let args = App::new("starship")
|
||||||
|
.arg(Arg::with_name("status_code"))
|
||||||
|
.get_matches_from(vec!["starship", "0"]);
|
||||||
|
|
||||||
|
let segment = modules::handle("line_break", &args);
|
||||||
|
print::stringify_segment(segment)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn nodejs_section_bench(b: &mut Bencher) {
|
||||||
|
b.iter(|| {
|
||||||
|
let args = App::new("starship")
|
||||||
|
.arg(Arg::with_name("status_code"))
|
||||||
|
.get_matches_from(vec!["starship", "0"]);
|
||||||
|
|
||||||
|
let segment = modules::handle("nodejs", &args);
|
||||||
|
print::stringify_segment(segment)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue