avm1: Math tests: Substitute some trivial expected values and add TODOs about @epsilon

This commit is contained in:
TÖRÖK Attila 2024-08-10 22:54:46 +02:00
parent 3573322c6d
commit c3529afe11
1 changed files with 16 additions and 10 deletions

View File

@ -199,9 +199,10 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
// TODO: figure out the exact f64 returned, and add @epsilon as needed, see test_exp
[-1.0] => f64::acos(-1.0),
[0.0] => f64::acos(0.0),
[1.0] => f64::acos(1.0)
[1.0] => 0.0 // f64::acos(1.0)
}
);
@ -209,8 +210,9 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
// TODO: figure out the exact f64 returned, and add @epsilon as needed, see test_exp
[-1.0] => f64::asin(-1.0),
[0.0] => f64::asin(0.0),
[0.0] => 0.0, // f64::asin(0.0),
[1.0] => f64::asin(1.0)
}
);
@ -219,8 +221,9 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
// TODO: figure out the exact f64 returned, and add @epsilon as needed, see test_exp
[-1.0] => f64::atan(-1.0),
[0.0] => f64::atan(0.0),
[0.0] => 0.0, // f64::atan(0.0),
[1.0] => f64::atan(1.0)
}
);
@ -238,7 +241,7 @@ mod tests {
[] => f64::NAN,
[Value::Null] => f64::NAN,
[0.0] => 1.0,
[std::f64::consts::PI] => f64::cos(std::f64::consts::PI)
[std::f64::consts::PI] => -1.0 // f64::cos(std::f64::consts::PI)
}
);
@ -298,8 +301,8 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
[0.0] => f64::sin(0.0),
[std::f64::consts::PI / 2.0] => f64::sin(std::f64::consts::PI / 2.0)
[0.0] => 0.0, // f64::sin(0.0),
[std::f64::consts::PI / 2.0] => 1.0 // f64::sin(std::f64::consts::PI / 2.0)
}
);
@ -307,7 +310,8 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
[0.0] => f64::sqrt(0.0),
[0.0] => 0.0, // f64::sqrt(0.0),
// TODO: figure out the exact f64 returned, and add @epsilon as needed, see test_exp
[5.0] => f64::sqrt(5.0)
}
);
@ -316,7 +320,8 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
[0.0] => f64::tan(0.0),
[0.0] => 0.0, // f64::tan(0.0),
// TODO: figure out the exact f64 returned, and add @epsilon as needed, see test_exp
[1.0] => f64::tan(1.0)
}
);
@ -346,9 +351,10 @@ mod tests {
[19] => {
[] => f64::NAN,
[Value::Null] => f64::NAN,
// TODO: figure out the exact f64 returned, and add @epsilon as needed, see test_exp
[2.0] => f64::ln(2.0),
[0.0] => f64::ln(0.0),
[1.0] => f64::ln(1.0)
[0.0] => f64::NEG_INFINITY, // f64::ln(0.0),
[1.0] => 0 // f64::ln(1.0)
}
);