mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Order query expression results (#32)
Expressions are scheduled based on dependencies and thusthe gathered expression values may not be in the same order as in source. Reorder to match the source. Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
519cce5b33
commit
6228eaab4a
@@ -182,12 +182,12 @@ pub fn check_output(computed_results: &[Value], expected_results: &[Value]) -> R
|
||||
}
|
||||
|
||||
fn query_results_to_value(query_results: QueryResults) -> Result<Value> {
|
||||
if let Some(query_result) = query_results.results.last() {
|
||||
if let Some(query_result) = query_results.result.last() {
|
||||
if !query_result.bindings.is_empty_object() {
|
||||
return Ok(query_result.bindings.clone());
|
||||
} else {
|
||||
return match query_result.expressions.last() {
|
||||
Some(v) => Ok(v.clone()),
|
||||
Some(v) => Ok(v["value"].clone()),
|
||||
_ => bail!("no expressions in query results"),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user