Fix all of the math test except for block template-based methods.
This commit is contained in:
parent
d9f10290f5
commit
b897656cef
@ -336,6 +336,7 @@ impl Castable for serde_json::Value {
|
|||||||
|
|
||||||
impl CompareContextElement for serde_json::Value {
|
impl CompareContextElement for serde_json::Value {
|
||||||
fn equals(&self, other: &dyn ContextElement) -> bool {
|
fn equals(&self, other: &dyn ContextElement) -> bool {
|
||||||
|
// println!("Json equality check {:?} == {:?}", self, other);
|
||||||
// Handle other serde_json::Value
|
// Handle other serde_json::Value
|
||||||
match other.to_any().downcast_ref::<Self>() {
|
match other.to_any().downcast_ref::<Self>() {
|
||||||
None => (),
|
None => (),
|
||||||
|
@ -202,6 +202,7 @@ impl Castable for OwnedLiteral {
|
|||||||
|
|
||||||
impl CompareContextElement for OwnedLiteral {
|
impl CompareContextElement for OwnedLiteral {
|
||||||
fn equals(&self, other: &dyn ContextElement) -> bool {
|
fn equals(&self, other: &dyn ContextElement) -> bool {
|
||||||
|
// println!("Literal equality check {:?} == {:?}", self, other);
|
||||||
// If its an OwnedLiteral then compare them directly,
|
// If its an OwnedLiteral then compare them directly,
|
||||||
// otherwise defer to the other type's implementation of
|
// otherwise defer to the other type's implementation of
|
||||||
// CompareContextElement since the end user could add any
|
// CompareContextElement since the end user could add any
|
||||||
@ -220,27 +221,12 @@ impl CompareContextElement for OwnedLiteral {
|
|||||||
OwnedLiteral::LNegativeInteger(self_num),
|
OwnedLiteral::LNegativeInteger(self_num),
|
||||||
OwnedLiteral::LNegativeInteger(other_num),
|
OwnedLiteral::LNegativeInteger(other_num),
|
||||||
) => self_num == other_num,
|
) => self_num == other_num,
|
||||||
|
(OwnedLiteral::LString(self_text), _) | (_, OwnedLiteral::LString(self_text)) => {
|
||||||
|
false
|
||||||
|
}
|
||||||
(OwnedLiteral::LFloat(self_num), OwnedLiteral::LFloat(other_num)) => {
|
(OwnedLiteral::LFloat(self_num), OwnedLiteral::LFloat(other_num)) => {
|
||||||
self_num == other_num
|
self_num == other_num
|
||||||
}
|
}
|
||||||
(OwnedLiteral::LPositiveInteger(self_num), OwnedLiteral::LString(other_text)) => {
|
|
||||||
&self_num.to_string() == other_text
|
|
||||||
}
|
|
||||||
(OwnedLiteral::LString(self_text), OwnedLiteral::LPositiveInteger(other_num)) => {
|
|
||||||
self_text == &other_num.to_string()
|
|
||||||
}
|
|
||||||
(OwnedLiteral::LNegativeInteger(self_num), OwnedLiteral::LString(other_text)) => {
|
|
||||||
&self_num.to_string() == other_text
|
|
||||||
}
|
|
||||||
(OwnedLiteral::LString(self_text), OwnedLiteral::LNegativeInteger(other_num)) => {
|
|
||||||
self_text == &other_num.to_string()
|
|
||||||
}
|
|
||||||
(OwnedLiteral::LFloat(self_num), OwnedLiteral::LString(other_text)) => {
|
|
||||||
&self_num.to_string() == other_text
|
|
||||||
}
|
|
||||||
(OwnedLiteral::LString(self_text), OwnedLiteral::LFloat(other_num)) => {
|
|
||||||
self_text == &other_num.to_string()
|
|
||||||
}
|
|
||||||
(OwnedLiteral::LFloat(self_num), OwnedLiteral::LPositiveInteger(other_num)) => {
|
(OwnedLiteral::LFloat(self_num), OwnedLiteral::LPositiveInteger(other_num)) => {
|
||||||
*self_num == (*other_num as f64)
|
*self_num == (*other_num as f64)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user