mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 02:53:07 +03:00
Add test to check case of field.
This commit is contained in:
parent
46d4330637
commit
3d2efb0dff
@ -20,3 +20,7 @@ global.assert_dict_required = function(c) {
|
|||||||
assert.strictEqual(c.b, "a");
|
assert.strictEqual(c.b, "a");
|
||||||
assert.strictEqual(c.c, 4);
|
assert.strictEqual(c.c, 4);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
global.assert_camel_case = function(dict) {
|
||||||
|
assert.strictEqual(dict.wierd_fieldName, 1);
|
||||||
|
}
|
||||||
|
@ -16,6 +16,7 @@ extern "C" {
|
|||||||
#[wasm_bindgen(js_name = mk_dict_a)]
|
#[wasm_bindgen(js_name = mk_dict_a)]
|
||||||
fn mk_dict_a2() -> Option<A>;
|
fn mk_dict_a2() -> Option<A>;
|
||||||
fn assert_dict_required(r: &Required);
|
fn assert_dict_required(r: &Required);
|
||||||
|
fn assert_camel_case(dict: &PreserveNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
@ -51,3 +52,8 @@ fn many_types() {
|
|||||||
fn required() {
|
fn required() {
|
||||||
assert_dict_required(Required::new(3, "a").c(4));
|
assert_dict_required(Required::new(3, "a").c(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen_test]
|
||||||
|
fn correct_casing_in_js() {
|
||||||
|
assert_camel_case(PreserveNames::new().wierd_field_name(4));
|
||||||
|
}
|
||||||
|
4
crates/webidl-tests/dictionary.webidl
vendored
4
crates/webidl-tests/dictionary.webidl
vendored
@ -45,3 +45,7 @@ dictionary Required {
|
|||||||
required long a;
|
required long a;
|
||||||
long c;
|
long c;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dictionary PreserveNames {
|
||||||
|
long wierd_fieldName;
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user