-
Notifications
You must be signed in to change notification settings - Fork 22
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
ff9fa7a
commit 1ffb5d2
Showing
12 changed files
with
118 additions
and
110 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
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
28 changes: 28 additions & 0 deletions
28
sylvia/tests/ui/attributes/attr_forwarding/invalid_sv_attr.rs
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,28 @@ | ||
#![allow(unused_imports)] | ||
use sylvia::cw_std::{Response, StdResult}; | ||
use sylvia::types::{ExecCtx, InstantiateCtx}; | ||
|
||
pub struct Contract; | ||
|
||
#[sylvia::contract] | ||
#[sv::msg_attr(random_msg, PartialOrd)] | ||
#[sv::msg_attr(exec PartialOrd)] | ||
#[sv::msg_attr(PartialOrd)] | ||
#[sv::msg_attr(exec,)] | ||
impl Contract { | ||
pub const fn new() -> Self { | ||
Self | ||
} | ||
|
||
#[sv::msg(instantiate)] | ||
fn instantiate(&self, _ctx: InstantiateCtx) -> StdResult<Response> { | ||
Ok(Response::new()) | ||
} | ||
|
||
#[sv::msg(exec)] | ||
fn exec(&self, _ctx: ExecCtx) -> StdResult<Response> { | ||
Ok(Response::new()) | ||
} | ||
} | ||
|
||
fn main() {} |
21 changes: 21 additions & 0 deletions
21
sylvia/tests/ui/attributes/attr_forwarding/invalid_sv_attr.stderr
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,21 @@ | ||
error: Invalid message type, expected one of: `exec`, `query`, `instantiate`, `migrate`, `reply` or `sudo`. | ||
--> tests/ui/attributes/attr_forwarding/invalid_sv_attr.rs:7:1 | ||
| | ||
7 | #[sylvia::contract] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the attribute macro `sylvia::contract` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Expected attribute of the form: `#[sv::msg_attr(msg_type, attribute_to_forward)]` | ||
--> tests/ui/attributes/attr_forwarding/invalid_sv_attr.rs:9:21 | ||
| | ||
9 | #[sv::msg_attr(exec PartialOrd)] | ||
| ^^^^^^^^^^ | ||
|
||
error: Expected attribute of the form: `#[sv::msg_attr(msg_type, attribute_to_forward)]` | ||
--> tests/ui/attributes/attr_forwarding/invalid_sv_attr.rs:7:1 | ||
| | ||
7 | #[sylvia::contract] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the attribute macro `sylvia::contract` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,14 +1,7 @@ | ||
error: Invalid custom type. | ||
|
||
= note: Expected `#[sv::custom(msg=SomeMsg, query=SomeQuery)]` | ||
|
||
= note: Expected `#[sv::custom(msg=SomeMsg, query=SomeQuery)]`. | ||
--> tests/ui/attributes/custom/invalid_custom.rs:12:14 | ||
| | ||
12 | #[sv::custom(mgs=MyMsg)] | ||
| ^^^ | ||
|
||
error: unexpected token | ||
--> tests/ui/attributes/custom/invalid_custom.rs:12:1 | ||
| | ||
12 | #[sv::custom(mgs=MyMsg)] | ||
| ^ |
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,14 +1,7 @@ | ||
error: Unexpected tokens inside `sv::messages` attribtue. | ||
|
||
= note: Maximal supported form of attribute: `#[sv::messages(interface::path as InterfaceName: custom(msg, query))]`. | ||
|
||
--> tests/ui/attributes/messages/unexpected_token.rs:24:25 | ||
| | ||
24 | #[sv::messages(interface(Empty))] | ||
| ^ | ||
|
||
error: unexpected token | ||
--> tests/ui/attributes/messages/unexpected_token.rs:24:1 | ||
| | ||
24 | #[sv::messages(interface(Empty))] | ||
| ^ |