Add test to check case of field.

This commit is contained in:
Richard Dodd 2019-01-07 17:09:10 +00:00
parent 46d4330637
commit 3d2efb0dff
3 changed files with 14 additions and 0 deletions

View File

@ -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);
}

View File

@ -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));
}

View File

@ -45,3 +45,7 @@ dictionary Required {
required long a;
long c;
};
dictionary PreserveNames {
long wierd_fieldName;
};