Skip to content

Commit

Permalink
Fix warnings and tests for Math
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickforall committed Mar 14, 2020
1 parent 698ebb3 commit d960870
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions boa/src/builtins/math/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::*;
use crate::{builtins::value::ValueData, exec::Executor, forward, forward_val, realm::Realm};
use crate::{exec::Executor, forward, forward_val, realm::Realm};
use std::f64;

#[test]
Expand Down Expand Up @@ -395,7 +394,7 @@ fn pow() {
assert_eq!(a.to_num(), f64::from(1024));
assert_eq!(b.to_num(), f64::from(49));
assert_eq!(c.to_num(), f64::from(2.0));
assert_eq!(d.to_num(), f64::from(0.02040816326530612));
assert_eq!(d.to_num(), f64::from(0.020_408_163_265_306_12));
}

#[test]
Expand Down Expand Up @@ -504,15 +503,15 @@ fn tan() {
let realm = Realm::create();
let mut engine = Executor::new(realm);
let init = r#"
var a = Math.tan(1);
var a = Math.tan(1.1);
"#;

forward(&mut engine, init);

let a = forward_val(&mut engine, "a").unwrap();

assert_eq!(a.to_num(), f64::from(1.557_407_724_654_902));
assert_eq!(a.to_num(), f64::from(1.964_759_657_248_652_5));
}

#[test]
Expand All @@ -530,7 +529,7 @@ fn tanh() {
let a = forward_val(&mut engine, "a").unwrap();
let b = forward_val(&mut engine, "b").unwrap();

assert_eq!(a.to_num(), f64::from(0.761_594_155_955_c764_9));
assert_eq!(a.to_num(), f64::from(0.761_594_155_955_764_9));
assert_eq!(b.to_num(), f64::from(0));
}

Expand Down

0 comments on commit d960870

Please sign in to comment.