Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik authored and nrc committed Aug 29, 2024
1 parent 77cb828 commit a9230ac
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/enum-with-discriminants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ enum Enum {
Foo,
Bar = 42,
}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/enum-zero-variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ extern crate derive_new;
//~^ ERROR proc-macro derive
//~^^ HELP #[derive(new)] cannot be implemented for enums with zero variants
enum Enum {}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/multiple-new-attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ struct Foo {
#[new(value = "42")]
y: i32,
}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/new-invalid-attr-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ struct Foo {
#[new = "foo"]
x: i32,
}

fn main() {}
4 changes: 3 additions & 1 deletion testcrate/tests/compile-fail/new-invalid-value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ extern crate derive_new;
//~^ ERROR produced unparsable tokens
struct Foo {
#[new(value = "hello@world")]
//~^ ERROR expected one of
//~^ ERROR expected one of
x: i32,
}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/new-list-invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ struct Foo {
#[new(foo)]
x: i32,
}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/new-name-value-invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ struct Foo {
#[new(foo = "bar")]
x: i32,
}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/new-nested-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ struct Foo {
#[new(foo("bar"))]
x: i32,
}

fn main() {}
4 changes: 3 additions & 1 deletion testcrate/tests/compile-fail/new-nested-literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ extern crate derive_new;

#[derive(new)]
//~^ ERROR proc-macro derive
//~^^ HELP Invalid #[new] attribute: literal value in #[new(..)]
//~^^ HELP Invalid #[new] attribute: expected identifier
struct Foo {
#[new("foo")]
x: i32,
}

fn main() {}
2 changes: 2 additions & 0 deletions testcrate/tests/compile-fail/new-non-literal-value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ struct Foo {
#[new(value = false)]
x: i32,
}

fn main() {}

0 comments on commit a9230ac

Please sign in to comment.