()
| 564 | |
| 565 | #[test] |
| 566 | fn test_min() { |
| 567 | [ |
| 568 | ("min single", "min(1) == 1"), |
| 569 | ("min multiple", "min(1, 2, 3) == 1"), |
| 570 | ("min negative", "min(-1, 0) == -1"), |
| 571 | ("min float", "min(-1.0, 0.0) == -1.0"), |
| 572 | ( |
| 573 | "min float multiple", |
| 574 | "min(1.61803, 3.1415, 2.71828, 1.41421) == 1.41421", |
| 575 | ), |
| 576 | ("min list", "min([1, 2, 3]) == 1"), |
| 577 | ("min empty list", "min([]) == null"), |
| 578 | ("min no args", "min() == null"), |
| 579 | ] |
| 580 | .iter() |
| 581 | .for_each(|a| { |
| 582 | let input: &(&str, &str) = a; |
| 583 | let mut context = Context::default(); |
| 584 | context.add_function("min", super::min); |
| 585 | let ctx = Some(context); |
| 586 | let r = test_script(input.1, ctx); |
| 587 | assert_eq!(r, Ok(true.into()), "{}", input.0); |
| 588 | }); |
| 589 | } |
| 590 | |
| 591 | #[test] |
| 592 | fn test_starts_with() { |
nothing calls this directly
no test coverage detected