Migrate tests to new API

This commit is contained in:
bakaq
2024-10-12 17:41:48 -03:00
parent 2f82c78bc0
commit e21c772181
3 changed files with 247 additions and 266 deletions

View File

@@ -44,6 +44,16 @@ pub enum LeafAnswer {
},
}
impl LeafAnswer {
/// Creates a leaf answer with no residual goals.
pub fn from_bindings<S: Into<String>>(bindings: impl IntoIterator<Item = (S, Term)>) -> Self {
LeafAnswer::LeafAnswer {
bindings: bindings.into_iter().map(|(k, v)| (k.into(), v)).collect(),
residual_goals: Vec::new(),
}
}
}
/// Represents a Prolog term.
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]