|
|
@ -1,6 +1,6 @@ |
|
|
|
#![allow(clippy::float_cmp)] |
|
|
|
#![allow(clippy::float_cmp)] |
|
|
|
|
|
|
|
|
|
|
|
use crate::{builtins::Number, forward, forward_val, Context}; |
|
|
|
use crate::{builtins::Number, forward, forward_val, value::AbstractRelation, Context}; |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
fn integer_number_primitive_to_number_object() { |
|
|
|
fn integer_number_primitive_to_number_object() { |
|
|
@ -444,6 +444,34 @@ fn same_value() { |
|
|
|
assert_eq!(Number::equal(1.0, 1.0), true); |
|
|
|
assert_eq!(Number::equal(1.0, 1.0), true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
|
|
|
fn less_than() { |
|
|
|
|
|
|
|
assert_eq!( |
|
|
|
|
|
|
|
Number::less_than(f64::NAN, 0.0), |
|
|
|
|
|
|
|
AbstractRelation::Undefined |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert_eq!( |
|
|
|
|
|
|
|
Number::less_than(0.0, f64::NAN), |
|
|
|
|
|
|
|
AbstractRelation::Undefined |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert_eq!( |
|
|
|
|
|
|
|
Number::less_than(f64::NEG_INFINITY, 0.0), |
|
|
|
|
|
|
|
AbstractRelation::True |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert_eq!( |
|
|
|
|
|
|
|
Number::less_than(0.0, f64::NEG_INFINITY), |
|
|
|
|
|
|
|
AbstractRelation::False |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert_eq!( |
|
|
|
|
|
|
|
Number::less_than(f64::INFINITY, 0.0), |
|
|
|
|
|
|
|
AbstractRelation::False |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
assert_eq!( |
|
|
|
|
|
|
|
Number::less_than(0.0, f64::INFINITY), |
|
|
|
|
|
|
|
AbstractRelation::True |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
fn same_value_zero() { |
|
|
|
fn same_value_zero() { |
|
|
|
assert_eq!(Number::same_value_zero(0.0, 0.0), true); |
|
|
|
assert_eq!(Number::same_value_zero(0.0, 0.0), true); |
|
|
|