Fix nullable-unwrapped bindgen test

This commit is contained in:
Richard Feldman 2022-05-28 20:41:04 -04:00
parent 46a7d341a3
commit 368a9d4a4e
No known key found for this signature in database
GPG Key ID: 7E4127D1E4241798
2 changed files with 4 additions and 7 deletions

View File

@ -1,6 +1,6 @@
mod bindings; mod bindings;
use bindings::{StrConsList, StrConsList_Cons}; use bindings::StrConsList;
use indoc::indoc; use indoc::indoc;
extern "C" { extern "C" {
@ -38,10 +38,7 @@ pub extern "C" fn rust_main() -> i32 {
"# "#
), ),
tag_union, tag_union,
StrConsList::Cons(StrConsList_Cons { StrConsList::Cons("small str".into(), StrConsList::Nil),
f0: "small str".into(),
f1: StrConsList::Nil
}),
StrConsList::Nil, StrConsList::Nil,
); // Debug ); // Debug

View File

@ -117,8 +117,8 @@ mod bindgen_cli_run {
`Blah 456` is: NonRecursive::Blah(456) `Blah 456` is: NonRecursive::Blah(456)
"#), "#),
nullable_unwrapped:"nullable-unwrapped" => indoc!(r#" nullable_unwrapped:"nullable-unwrapped" => indoc!(r#"
tag_union was: StrConsList::Cons(StrConsList_Cons { f0: "World!", f1: StrConsList::Cons(StrConsList_Cons { f0: "Hello ", f1: StrConsList::Nil }) }) tag_union was: StrConsList::Cons("World!", StrConsList::Cons("Hello ", StrConsList::Nil))
`Cons "small str" Nil` is: StrConsList::Cons(StrConsList_Cons { f0: "small str", f1: StrConsList::Nil }) `Cons "small str" Nil` is: StrConsList::Cons("small str", StrConsList::Nil)
`Nil` is: StrConsList::Nil `Nil` is: StrConsList::Nil
"#), "#),
recursive_union:"recursive-union" => indoc!(r#" recursive_union:"recursive-union" => indoc!(r#"