Skip to content

Commit

Permalink
Test setting/getting c: OtherDict
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosichert committed Apr 24, 2024
1 parent 914f54b commit eacb790
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion crates/webidl-tests/dictionary.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::generated::{CamelCaseMe, ManyTypes, PreserveNames, Required, A, B, C};
use crate::generated::{CamelCaseMe, ManyTypes, OtherDict, PreserveNames, Required, A, B, C};
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;

Expand Down Expand Up @@ -67,6 +67,9 @@ fn roundtrip_set_get() {
many_types.n4(4);
many_types.n5(5);
many_types.n6(6);
let mut other_dict = OtherDict::new();
other_dict.a(42);
many_types.c(&other_dict);

{
use crate::generated::ManyTypesGetters;
Expand All @@ -77,5 +80,6 @@ fn roundtrip_set_get() {
assert_eq!(many_types.n4(), 4);
assert_eq!(many_types.n5(), 5);
assert_eq!(many_types.n6(), 6);
assert_eq!(many_types.c(), other_dict);
}
}
3 changes: 1 addition & 2 deletions crates/webidl-tests/webidls/enabled/dictionary.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ dictionary ManyTypes {
short n4;
unsigned long n5;
long n6;
// TODO: needs fixing
// OtherDict c;
OtherDict c;
};

dictionary OtherDict {
Expand Down

0 comments on commit eacb790

Please sign in to comment.