Skip to content

Commit

Permalink
Write failing test for pick on with_items_range
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Haarhoff committed Mar 6, 2023
1 parent 8ef2e25 commit 602cf73
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/expandable/multi_iter_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ mod tests {
assert_eq!(benchmark.len(), 10);
}

#[test]
#[should_panic]
fn expand_multi_range_should_limit_requests_using_the_pick_option() {
let text = "---\nname: foobar\nrequest:\n url: /api/{{ item }}\npick: 3\nwith_items_range:\n start: 2\n step: 2\n stop: 20";
let docs = yaml_rust::YamlLoader::load_from_str(text).unwrap();
let doc = &docs[0];
let mut benchmark: Benchmark = Benchmark::new();

expand(doc, &mut benchmark);

assert!(is_that_you(doc));
assert_eq!(benchmark.len(), 3);
}

#[test]
#[should_panic]
fn invalid_expand() {
Expand Down

0 comments on commit 602cf73

Please sign in to comment.