mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
tests: adds a bench for rustups subcommand parsing
This commit is contained in:
parent
8da0303bc0
commit
a822ad8c27
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,11 @@ fn build_app(b: &mut Bencher) { b.iter(|| build_cli()); }
|
|||
#[bench]
|
||||
fn parse_clean(b: &mut Bencher) { b.iter(|| build_cli().get_matches_from(vec![""])); }
|
||||
|
||||
#[bench]
|
||||
fn parse_subcommands(b: &mut Bencher) {
|
||||
b.iter(|| build_cli().get_matches_from(vec!["rustup override add stable"]));
|
||||
}
|
||||
|
||||
pub fn build_cli() -> App<'static, 'static> {
|
||||
App::new("rustup")
|
||||
.version("0.9.0") // Simulating
|
||||
|
|
Loading…
Reference in a new issue