Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
goober
  • Loading branch information
decahedron1 committed Oct 21, 2023
1 parent 6eac6f1 commit 407363b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ts-rs/tests/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ fn default() {
}
assert_eq!(
B::<()>::decl(),
"interface B<U = A<number> | null> { u: U, }"
"interface B<U = (A<number> | null)> { u: U, }"
);
assert!(B::<()>::dependencies().iter().any(|dep| dep.ts_name == "A"));

Expand Down
2 changes: 1 addition & 1 deletion ts-rs/tests/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fn list() {

assert_eq!(
List::decl(),
"interface List { data: Array<number> | null, }"
"interface List { data: (Array<number> | null), }"
);
}
4 changes: 2 additions & 2 deletions ts-rs/tests/optional_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Optional {
#[test]
fn test() {
#[cfg(not(feature = "serde-compat"))]
assert_eq!(Optional::inline(), "({ a?: number, b: string | null, })");
assert_eq!(Optional::inline(), "{ a?: number, b: (string | null), }");
#[cfg(feature = "serde-compat")]
assert_eq!(Optional::inline(), "({ a?: number, b?: string, })")
assert_eq!(Optional::inline(), "{ a?: number, b?: string, }")
}
2 changes: 1 addition & 1 deletion ts-rs/tests/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ struct Fallible {
fn test() {
assert_eq!(
Fallible::inline(),
"({ a: { ok: number } | { err: string }, })"
"{ a: ({ ok: number } | { err: string }), }"
)
}
2 changes: 1 addition & 1 deletion ts-rs/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ struct Simple {
fn test_def() {
assert_eq!(
Simple::inline(),
"{ a: number, b: string, c: [number, string, number], d: Array<string>, e: string | null, f: string, g: string | null, }"
"{ a: number, b: string, c: [number, string, number], d: Array<string>, e: (string | null), f: string, g: (string | null), }"
)
}

0 comments on commit 407363b

Please sign in to comment.