Test for AsRef implementations

Part of #670
This commit is contained in:
Matt Kraai 2018-08-17 13:09:30 -07:00
parent 7a08da9205
commit 687412ec50
14 changed files with 16 additions and 0 deletions

View File

@ -306,4 +306,5 @@ fn array_inheritance() {
let array = Array::new();
assert!(array.is_instance_of::<Array>());
assert!(array.is_instance_of::<Object>());
let _: &Object = array.as_ref();
}

View File

@ -41,4 +41,5 @@ fn arraybuffer_inheritance() {
let buf = ArrayBuffer::new(4);
assert!(buf.is_instance_of::<ArrayBuffer>());
assert!(buf.is_instance_of::<Object>());
let _: &Object = buf.as_ref();
}

View File

@ -18,4 +18,5 @@ fn boolean_inheritance() {
let b = Boolean::new(&JsValue::from(true));
assert!(b.is_instance_of::<Boolean>());
assert!(b.is_instance_of::<Object>());
let _: &Object = b.as_ref();
}

View File

@ -50,4 +50,6 @@ fn dataview_inheritance() {
assert!(v.is_instance_of::<DataView>());
assert!(v.is_instance_of::<Object>());
let _: &Object = v.as_ref();
}

View File

@ -413,4 +413,5 @@ fn date_inheritance() {
let date = Date::new(&"August 19, 1975 23:15:30".into());
assert!(date.is_instance_of::<Date>());
assert!(date.is_instance_of::<Object>());
let _: &Object = date.as_ref();
}

View File

@ -42,4 +42,5 @@ fn error_inheritance() {
let error = Error::new("test");
assert!(error.is_instance_of::<Error>());
assert!(error.is_instance_of::<Object>());
let _: &Object = error.as_ref();
}

View File

@ -52,4 +52,6 @@ fn evalerror_inheritance() {
assert!(error.is_instance_of::<EvalError>());
assert!(error.is_instance_of::<Error>());
assert!(error.is_instance_of::<Object>());
let _: &Error = error.as_ref();
let _: &Object = error.as_ref();
}

View File

@ -66,4 +66,5 @@ fn to_string() {
fn function_inheritance() {
assert!(MAX.is_instance_of::<Function>());
assert!(MAX.is_instance_of::<Object>());
let _: &Object = MAX.as_ref();
}

View File

@ -93,4 +93,5 @@ fn map_inheritance() {
let map = Map::new();
assert!(map.is_instance_of::<Map>());
assert!(map.is_instance_of::<Object>());
let _: &Object = map.as_ref();
}

View File

@ -111,4 +111,5 @@ fn number_inheritance() {
let n = Number::new(&JsValue::from(42));
assert!(n.is_instance_of::<Number>());
assert!(n.is_instance_of::<Object>());
let _: &Object = n.as_ref();
}

View File

@ -7,6 +7,7 @@ fn regexp_inheritance() {
let re = RegExp::new(".", "");
assert!(re.is_instance_of::<RegExp>());
assert!(re.is_instance_of::<Object>());
let _: &Object = re.as_ref();
}
#[wasm_bindgen_test]

View File

@ -87,4 +87,5 @@ fn set_inheritance() {
let set = Set::new(&JsValue::undefined());
assert!(set.is_instance_of::<Set>());
assert!(set.is_instance_of::<Object>());
let _: &Object = set.as_ref();
}

View File

@ -57,4 +57,5 @@ fn weakmap_inheritance() {
let map = WeakMap::new();
assert!(map.is_instance_of::<WeakMap>());
assert!(map.is_instance_of::<Object>());
let _: &Object = map.as_ref();
}

View File

@ -47,4 +47,5 @@ fn weakset_inheritance() {
let set = WeakSet::new();
assert!(set.is_instance_of::<WeakSet>());
assert!(set.is_instance_of::<Object>());
let _: &Object = set.as_ref();
}