mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-24 02:23:11 +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.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)]
|
||||
fn mk_dict_a2() -> Option<A>;
|
||||
fn assert_dict_required(r: &Required);
|
||||
fn assert_camel_case(dict: &PreserveNames);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
@ -51,3 +52,8 @@ fn many_types() {
|
||||
fn required() {
|
||||
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;
|
||||
long c;
|
||||
};
|
||||
|
||||
dictionary PreserveNames {
|
||||
long wierd_fieldName;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user