-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostics and add ui tests
- Loading branch information
1 parent
83310eb
commit 5e35bdb
Showing
12 changed files
with
506 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#[test] | ||
fn ui() { | ||
let t = trybuild::TestCases::new(); | ||
t.compile_fail("tests/ui/*.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 @@ | ||
use spacetimedb::ReducerContext; | ||
|
||
struct Test; | ||
|
||
#[spacetimedb::reducer] | ||
fn bad_type(_ctx: &ReducerContext, _a: Test) {} | ||
|
||
#[spacetimedb::reducer] | ||
fn bad_return_type(_ctx: &ReducerContext) -> Test { | ||
Test | ||
} | ||
|
||
#[spacetimedb::reducer] | ||
fn lifetime<'a>(_ctx: &ReducerContext, _a: &'a str) {} | ||
|
||
#[spacetimedb::reducer] | ||
fn type_param<T>() {} | ||
|
||
#[spacetimedb::reducer] | ||
fn const_param<const X: u8>() {} | ||
|
||
#[spacetimedb::reducer] | ||
fn missing_ctx(_a: u8) {} | ||
|
||
#[spacetimedb::reducer] | ||
fn ctx_by_val(_ctx: ReducerContext, _a: u8) {} | ||
|
||
fn main() {} |
Oops, something went wrong.