1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-18 11:05:19 +00:00
starship/benches/benchmarks.rs
Matan Kushner ab9ba27231
Revert "Parallelize nodejs file checks"
This reverts commit 99bdf27eca.
2019-04-12 13:10:31 -04:00

46 lines
1.1 KiB
Rust

#![feature(test)]
extern crate test;
#[cfg(test)]
mod tests {
use clap::{App, Arg};
use starship::{modules, print};
use test::Bencher;
#[bench]
fn full_prompt_bench(b: &mut Bencher) {
b.iter(|| {
let args = App::new("starship")
.arg(Arg::with_name("status_code"))
.get_matches_from(vec!["starship", "0"]);
starship::print::prompt(args)
});
}
#[bench]
fn char_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("char", &args);
print::stringify_segment(segment)
});
}
#[bench]
fn dir_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("dir", &args);
print::stringify_segment(segment)
});
}
}