(test_result: &ResourceTestResult)
| 568 | /// * `bool` - True if the test result is in the desired state, false otherwise |
| 569 | #[must_use] |
| 570 | pub fn in_desired_state(test_result: &ResourceTestResult) -> bool { |
| 571 | match &test_result.result { |
| 572 | TestResult::Resource(result) => { |
| 573 | result.in_desired_state |
| 574 | }, |
| 575 | TestResult::Group(results) => { |
| 576 | for result in results { |
| 577 | if !in_desired_state(result) { |
| 578 | return false; |
| 579 | } |
| 580 | } |
| 581 | true |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | /// Parse input string as JSON or YAML and return a serde_json::Value. |
| 587 | /// |