From feeaf17fe6e65c1eb8d10a8e6a2777cb9d6bf070 Mon Sep 17 00:00:00 2001 From: Tpt Date: Mon, 17 Apr 2023 08:48:34 +0200 Subject: [PATCH] Test: fixes SPARQL query results isomorphism --- testsuite/src/sparql_evaluator.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/testsuite/src/sparql_evaluator.rs b/testsuite/src/sparql_evaluator.rs index b01aa2dd..30512a99 100644 --- a/testsuite/src/sparql_evaluator.rs +++ b/testsuite/src/sparql_evaluator.rs @@ -453,16 +453,17 @@ fn are_query_results_isomorphic( fn compare_solutions(expected: &[(Variable, Term)], actual: &[(Variable, Term)]) -> bool { let mut bnode_map = HashMap::new(); - expected.iter().zip(actual).all( - move |((expected_variable, expected_value), (actual_variable, actual_value))| { - expected_variable == actual_variable - && compare_terms( - expected_value.as_ref(), - actual_value.as_ref(), - &mut bnode_map, - ) - }, - ) + expected.len() == actual.len() + && expected.iter().zip(actual).all( + move |((expected_variable, expected_value), (actual_variable, actual_value))| { + expected_variable == actual_variable + && compare_terms( + expected_value.as_ref(), + actual_value.as_ref(), + &mut bnode_map, + ) + }, + ) } fn compare_terms<'a>(