diff --git a/src/expandable/multi_iter_request.rs b/src/expandable/multi_iter_request.rs index 4e2f345..46d8de5 100644 --- a/src/expandable/multi_iter_request.rs +++ b/src/expandable/multi_iter_request.rs @@ -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() {