-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68fdbdb
commit 33d2aea
Showing
13 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#[rustversion::attr(not(nightly), ignore)] | ||
#[test] | ||
fn test_macro() { | ||
let t = trybuild::TestCases::new(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error: Cannot parse attribute as list | ||
--> tests/macro/empty_attr.rs:6:3 | ||
| | ||
6 | #[endpoint] | ||
| ^^^^^^^^ | ||
|
||
error: Attribute cannot be empty | ||
--> tests/macro/empty_attr.rs:10:3 | ||
| | ||
10 | #[endpoint()] | ||
| ^^^^^^^^^^ | ||
|
||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/empty_attr.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
error: May only mark one field as raw | ||
--> tests/macro/invalid_data.rs:19:5 | ||
| | ||
19 | / #[endpoint(raw)] | ||
20 | | pub data_two: Vec<u8>, | ||
| |_________________________^ | ||
|
||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/invalid_data.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default | ||
|
||
error[E0308]: mismatched types | ||
--> tests/macro/invalid_data.rs:5:17 | ||
| | ||
5 | #[derive(Debug, Endpoint, Serialize)] | ||
| ^^^^^^^^ | ||
| | | ||
| expected `Vec<u8>`, found `String` | ||
| arguments to this enum variant are incorrect | ||
| | ||
= note: expected struct `Vec<u8>` | ||
found struct `std::string::String` | ||
help: the type constructed contains `std::string::String` due to the type of the argument passed | ||
--> tests/macro/invalid_data.rs:5:17 | ||
| | ||
5 | #[derive(Debug, Endpoint, Serialize)] | ||
| ^^^^^^^^ this argument influences the type of `Some` | ||
note: tuple variant defined here | ||
--> $RUST/core/src/option.rs | ||
= note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
help: call `Into::into` on this expression to convert `std::string::String` into `Vec<u8>` | ||
| | ||
5 | #[derive(Debug, Endpoint.into(), Serialize)] | ||
| +++++++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/invalid_method.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default | ||
|
||
error[E0599]: no variant or associated item named `TEST` found for enum `RequestMethod` in the current scope | ||
--> tests/macro/invalid_method.rs:6:41 | ||
| | ||
6 | #[endpoint(path = "test/path", method = "TEST")] | ||
| ^^^^^^ variant or associated item not found in `RequestMethod` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: Unknown parameter | ||
--> tests/macro/invalid_result.rs:6:32 | ||
| | ||
6 | #[endpoint(path = "test/path", result = "DoesNotExist")] | ||
| ^^^^^^ | ||
|
||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/invalid_result.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/invalid_type.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default | ||
|
||
error[E0599]: no variant or associated item named `BAD` found for enum `RequestType` in the current scope | ||
--> tests/macro/invalid_type.rs:6:47 | ||
| | ||
6 | #[endpoint(path = "test/path", request_type = "BAD", response_type = "BAD")] | ||
| ^^^^^ variant or associated item not found in `RequestType` | ||
|
||
error[E0599]: no variant or associated item named `BAD` found for enum `ResponseType` in the current scope | ||
--> tests/macro/invalid_type.rs:6:70 | ||
| | ||
6 | #[endpoint(path = "test/path", request_type = "BAD", response_type = "BAD")] | ||
| ^^^^^ variant or associated item not found in `ResponseType` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error: Deriving `Endpoint` requires attaching an `endpoint` attribute | ||
--> tests/macro/no_attr.rs:5:17 | ||
| | ||
5 | #[derive(Debug, Endpoint, Serialize)] | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/no_attr.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error: Missing required parameter: path | ||
--> tests/macro/no_path.rs:5:17 | ||
| | ||
5 | #[derive(Debug, Endpoint, Serialize)] | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Endpoint` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
warning: unused import: `rustify::endpoint::Endpoint` | ||
--> tests/macro/no_path.rs:1:5 | ||
| | ||
1 | use rustify::endpoint::Endpoint; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default |