Skip to content

Commit

Permalink
Fix tests again.
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-uk1 committed Jan 11, 2019
1 parent e783639 commit 95ab937
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl<'a> Context<'a> {
if (type == 'symbol') {
const description = val.description;
if (description == null) {
return 'Symbol()';
return 'Symbol';
} else {
return 'Symbol(' + description + ')';
}
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ impl Clone for JsValue {
#[cfg(feature = "std")]
impl fmt::Debug for JsValue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use std::fmt::Write;
write!(f, "JsValue({})", self.as_debug_string())
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/wasm/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn api_get_false() -> JsValue {
#[wasm_bindgen]
pub fn api_test_bool(a: &JsValue, b: &JsValue, c: &JsValue) {
assert_eq!(a.as_bool(), Some(true));
assert_eq!(format!("{:?}", a), "true");
assert_eq!(format!("{:?}", a), "JsValue(true)");
assert_eq!(b.as_bool(), Some(false));
assert_eq!(c.as_bool(), None);
}
Expand All @@ -80,7 +80,7 @@ pub fn api_test_bool(a: &JsValue, b: &JsValue, c: &JsValue) {
pub fn api_mk_symbol() -> JsValue {
let a = JsValue::symbol(None);
assert!(a.is_symbol());
assert_eq!(format!("{:?}", a), "Symbol()");
assert_eq!(format!("{:?}", a), "JsValue(Symbol)");
return a;
}

Expand All @@ -100,7 +100,7 @@ pub fn api_assert_symbols(a: &JsValue, b: &JsValue) {
#[wasm_bindgen]
pub fn api_acquire_string(a: &JsValue, b: &JsValue) {
assert_eq!(a.as_string().unwrap(), "foo");
assert_eq!(format!("{:?}", a), "\"foo\"");
assert_eq!(format!("{:?}", a), "JsValue(\"foo\")");
assert_eq!(b.as_string(), None);
}

Expand Down

0 comments on commit 95ab937

Please sign in to comment.