Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oscartbeaumont committed Nov 26, 2023
1 parent 5b3f498 commit b22cf4b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ fn typescript_types() {
ExportError::InvalidName(
NamedLocation::Type,
#[cfg(not(windows))]
ExportPath::new_unsafe("tests/ts.rs:615:10"),
ExportPath::new_unsafe("tests/ts.rs:619:10"),
#[cfg(windows)]
ExportPath::new_unsafe("tests\ts.rs:615:10"),
ExportPath::new_unsafe("tests\ts.rs:619:10"),
r#"@odata.context"#.to_string()
)
);
Expand All @@ -285,9 +285,9 @@ fn typescript_types() {
ExportError::InvalidName(
NamedLocation::Type,
#[cfg(not(windows))]
ExportPath::new_unsafe("tests/ts.rs:619:10"),
ExportPath::new_unsafe("tests/ts.rs:623:10"),
#[cfg(windows)]
ExportPath::new_unsafe("tests\ts.rs:619:10"),
ExportPath::new_unsafe("tests\ts.rs:623:10"),
r#"@odata.context"#.to_string()
)
);
Expand All @@ -296,6 +296,10 @@ fn typescript_types() {
assert_ts!(Vec<MyEnum>, r#"({ A: string } | { B: number })[]"#);

assert_ts!(InlineTuple, r#"{ demo: [string, boolean] }"#);
assert_ts!(
InlineTuple2,
r#"{ demo: [{ demo: [string, boolean] }, boolean] }"#
);
}

#[derive(Type)]
Expand Down Expand Up @@ -631,3 +635,9 @@ pub struct InlineTuple {
#[specta(inline)]
demo: (String, bool),
}

#[derive(Type)]
pub struct InlineTuple2 {
#[specta(inline)]
demo: (InlineTuple, bool),
}

0 comments on commit b22cf4b

Please sign in to comment.