From 4f0ddd25ce745f426fd04b23e291eb5aa98aece4 Mon Sep 17 00:00:00 2001 From: Richard Dodd Date: Sun, 12 Aug 2018 21:27:27 +0100 Subject: [PATCH] Fix tests --- crates/webidl-tests/namespace.js | 16 ++++++++-------- crates/webidl-tests/namespace.rs | 6 +++--- crates/webidl-tests/namespace.webidl | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/webidl-tests/namespace.js b/crates/webidl-tests/namespace.js index a3b83d1f..7c86dcd5 100644 --- a/crates/webidl-tests/namespace.js +++ b/crates/webidl-tests/namespace.js @@ -1,11 +1,11 @@ const strictEqual = require('assert').strictEqual; -global.math = class { - powf(base, exp) { - return Math.pow(base, exp); - } +global.mathtest = {}; - add_one(val) { - return val + 1; - } -}; +global.mathtest.powf = function powf(base, exp) { + return Math.pow(base, exp); +} + +global.mathtest.add_one = function add_one(val) { + return val + 1; +} diff --git a/crates/webidl-tests/namespace.rs b/crates/webidl-tests/namespace.rs index 848239aa..49afc623 100644 --- a/crates/webidl-tests/namespace.rs +++ b/crates/webidl-tests/namespace.rs @@ -4,7 +4,7 @@ include!(concat!(env!("OUT_DIR"), "/namespace.rs")); #[wasm_bindgen_test] fn simple_namespace_test() { - assert_eq!(math::add_one(1), 2); - assert_eq!(math::powf(1.0, 100.0), 1.0); - assert_eq!(math::powf(10.0, 2.0), 100.0); + assert_eq!(mathtest::add_one(1), 2); + assert_eq!(mathtest::powf(1.0, 100.0), 1.0); + assert_eq!(mathtest::powf(10.0, 2.0), 100.0); } diff --git a/crates/webidl-tests/namespace.webidl b/crates/webidl-tests/namespace.webidl index c42a4cf6..1c3dbf3a 100644 --- a/crates/webidl-tests/namespace.webidl +++ b/crates/webidl-tests/namespace.webidl @@ -1,4 +1,4 @@ -namespace math { +namespace mathtest { long add_one(long val); double powf(double base, double exponent); };