Test: fixes SPARQL query results isomorphism

pull/461/head
Tpt 2 years ago committed by Thomas Tanon
parent f41c499ef3
commit feeaf17fe6
  1. 21
      testsuite/src/sparql_evaluator.rs

@ -453,16 +453,17 @@ fn are_query_results_isomorphic(
fn compare_solutions(expected: &[(Variable, Term)], actual: &[(Variable, Term)]) -> bool { fn compare_solutions(expected: &[(Variable, Term)], actual: &[(Variable, Term)]) -> bool {
let mut bnode_map = HashMap::new(); let mut bnode_map = HashMap::new();
expected.iter().zip(actual).all( expected.len() == actual.len()
move |((expected_variable, expected_value), (actual_variable, actual_value))| { && expected.iter().zip(actual).all(
expected_variable == actual_variable move |((expected_variable, expected_value), (actual_variable, actual_value))| {
&& compare_terms( expected_variable == actual_variable
expected_value.as_ref(), && compare_terms(
actual_value.as_ref(), expected_value.as_ref(),
&mut bnode_map, actual_value.as_ref(),
) &mut bnode_map,
}, )
) },
)
} }
fn compare_terms<'a>( fn compare_terms<'a>(

Loading…
Cancel
Save