()
| 542 | |
| 543 | #[test] |
| 544 | fn test_max() { |
| 545 | [ |
| 546 | ("max single", "max(1) == 1"), |
| 547 | ("max multiple", "max(1, 2, 3) == 3"), |
| 548 | ("max negative", "max(-1, 0) == 0"), |
| 549 | ("max float", "max(-1.0, 0.0) == 0.0"), |
| 550 | ("max list", "max([1, 2, 3]) == 3"), |
| 551 | ("max empty list", "max([]) == null"), |
| 552 | ("max no args", "max() == null"), |
| 553 | ] |
| 554 | .iter() |
| 555 | .for_each(|a| { |
| 556 | let input: &(&str, &str) = a; |
| 557 | let mut context = Context::default(); |
| 558 | context.add_function("max", super::max); |
| 559 | let ctx = Some(context); |
| 560 | let r = test_script(input.1, ctx); |
| 561 | assert_eq!(r, Ok(true.into()), "{}", input.0); |
| 562 | }); |
| 563 | } |
| 564 | |
| 565 | #[test] |
| 566 | fn test_min() { |
nothing calls this directly
no test coverage detected