Skip to content

Commit

Permalink
Port transparent tests to new integration test style
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau committed Sep 15, 2024
1 parent cf7f4b1 commit e621bdb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 64 deletions.
33 changes: 0 additions & 33 deletions schemars/tests/expected/transparent-struct.json

This file was deleted.

1 change: 1 addition & 0 deletions schemars/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mod smol_str;
mod std_types;
mod structs;
mod transform;
mod transparent;
#[cfg(feature = "url2")]
mod url;
#[cfg(feature = "uuid1")]
Expand Down
27 changes: 27 additions & 0 deletions schemars/tests/integration/transparent.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use crate::prelude::*;

#[derive(JsonSchema, Deserialize, Serialize, Default)]
#[serde(transparent)]
pub struct TransparentStruct {
inner: String,
}

#[test]
fn transparent_struct() {
test!(TransparentStruct)
.assert_identical::<String>()
.assert_allows_ser_roundtrip_default()
.assert_matches_de_roundtrip(arbitrary_values());
}

#[derive(JsonSchema, Deserialize, Serialize, Default)]
#[serde(transparent)]
pub struct TransparentNewType(String);

#[test]
fn transparent_newtype() {
test!(TransparentNewType)
.assert_identical::<String>()
.assert_allows_ser_roundtrip_default()
.assert_matches_de_roundtrip(arbitrary_values());
}
31 changes: 0 additions & 31 deletions schemars/tests/transparent.rs

This file was deleted.

0 comments on commit e621bdb

Please sign in to comment.