Compares two arrays independent of order
(expected: &Vec<Value>, actual: &Vec<Value>)
| 784 | |
| 785 | /// Compares two arrays independent of order |
| 786 | fn is_same_array(expected: &Vec<Value>, actual: &Vec<Value>) -> bool { |
| 787 | if expected.len() != actual.len() { |
| 788 | info!("{}", t!("dscresources.dscresource.diffArraySize")); |
| 789 | return false; |
| 790 | } |
| 791 | |
| 792 | for item in expected { |
| 793 | if !array_contains(actual, item) { |
| 794 | info!("{}", t!("dscresources.dscresource.diffMissingItem")); |
| 795 | return false; |
| 796 | } |
| 797 | } |
| 798 | |
| 799 | true |
| 800 | } |
| 801 | |
| 802 | fn array_contains(array: &Vec<Value>, find: &Value) -> bool { |
| 803 | for item in array { |
no test coverage detected