mirror of
https://github.com/xazukx/ts-rs.git
synced 2026-11-25 23:40:26 +00:00
Add ignored tests for missing implementations
This commit is contained in:
+50
-2
@@ -147,8 +147,6 @@ fn generic_struct() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
// #[ignore]
|
||||
// https://github.com/Aleph-Alpha/ts-rs/issues/56 TODO
|
||||
fn inline() {
|
||||
#[derive(TS)]
|
||||
struct Generic<T> {
|
||||
@@ -171,6 +169,56 @@ fn inline() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "We haven't figured out how to inline generics with bounds yet"]
|
||||
fn inline_with_bounds() {
|
||||
#[derive(TS)]
|
||||
struct Generic<T: ToString> {
|
||||
t: T,
|
||||
}
|
||||
|
||||
#[derive(TS)]
|
||||
struct Container {
|
||||
g: Generic<String>,
|
||||
#[ts(inline)]
|
||||
gi: Generic<String>,
|
||||
#[ts(flatten)]
|
||||
t: Generic<u32>,
|
||||
}
|
||||
|
||||
assert_eq!(Generic::<&'static str>::decl(), "type Generic<T> = { t: T, }");
|
||||
assert_eq!(
|
||||
Container::decl(),
|
||||
"type Container = { g: Generic<string>, gi: { t: string, }, t: number, }"
|
||||
// Actual output: { g: Generic<string>, gi: { t: T, }, t: T, }
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "We haven't figured out how to inline generics with defaults yet"]
|
||||
fn inline_with_default() {
|
||||
#[derive(TS)]
|
||||
struct Generic<T = String> {
|
||||
t: T,
|
||||
}
|
||||
|
||||
#[derive(TS)]
|
||||
struct Container {
|
||||
g: Generic<String>,
|
||||
#[ts(inline)]
|
||||
gi: Generic<String>,
|
||||
#[ts(flatten)]
|
||||
t: Generic<u32>,
|
||||
}
|
||||
|
||||
assert_eq!(Generic::<&'static str>::decl(), "type Generic<T = string> = { t: T, }");
|
||||
assert_eq!(
|
||||
Container::decl(),
|
||||
"type Container = { g: Generic<string>, gi: { t: string, }, t: number, }"
|
||||
// Actual output: { g: Generic<string>, gi: { t: T, }, t: T, }
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn default() {
|
||||
#[derive(TS)]
|
||||
|
||||
Reference in New Issue
Block a user