This repository was archived by the owner on Jul 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +19
-23
lines changed
src/_matchers/bevy_matchers Expand file tree Collapse file tree 8 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,6 @@ console_error_panic_hook.workspace = true
61
61
getrandom.workspace = true # enable js feature
62
62
forky = { workspace = true , features = [" web" ] }
63
63
64
- [dev-dependencies ]
65
- sweet = { workspace = true , features = [" test" ] }
66
-
67
-
68
64
[[test ]]
69
65
name = " hello_test"
70
66
path = " test_examples/hello_test.rs"
Original file line number Diff line number Diff line change 1
1
use bevy:: prelude:: * ;
2
- use sweet :: prelude:: * ;
2
+ use crate :: prelude:: * ;
3
3
4
4
type Func < T > = MockFunc < T , T , fn ( T ) -> T > ;
5
5
Original file line number Diff line number Diff line change 1
1
//! example usage of async tests
2
2
#![ cfg_attr( test, feature( test, custom_test_frameworks) ) ]
3
- #![ cfg_attr( test, test_runner( sweet :: test_runner) ) ]
3
+ #![ cfg_attr( test, test_runner( sweet_test :: test_runner) ) ]
4
4
5
- #[ sweet :: test]
5
+ #[ sweet_test :: test]
6
6
#[ ignore = "it returns error" ]
7
7
async fn returns_err ( ) -> Result < ( ) , String > { Err ( "foo" . to_string ( ) ) }
8
8
@@ -13,13 +13,13 @@ async fn dummy2() {
13
13
sweet_core:: sleep_secs ( 1 ) . await ;
14
14
panic ! ( "waddup" )
15
15
}
16
- #[ sweet :: test]
16
+ #[ sweet_test :: test]
17
17
// #[should_panic]
18
18
async fn dummy3 ( ) { sweet_core:: sleep_secs ( 1 ) . await ; }
19
- #[ sweet :: test]
19
+ #[ sweet_test :: test]
20
20
// #[should_panic]
21
21
async fn dummy4 ( ) { sweet_core:: sleep_secs ( 1 ) . await ; }
22
- #[ sweet :: test]
22
+ #[ sweet_test :: test]
23
23
#[ should_panic]
24
24
async fn dummy5 ( ) {
25
25
sweet_core:: sleep_secs ( 1 ) . await ;
Original file line number Diff line number Diff line change 1
1
//! example configuration for a test, just two lines and you're good to go
2
2
#![ cfg_attr( test, feature( test, custom_test_frameworks) ) ]
3
- #![ cfg_attr( test, test_runner( sweet :: test_runner) ) ]
4
- use sweet :: prelude:: * ;
3
+ #![ cfg_attr( test, test_runner( sweet_test :: test_runner) ) ]
4
+ use sweet_test :: prelude:: * ;
5
5
6
6
#[ test]
7
7
fn it_succeeds ( ) { assert ! ( true ) }
Original file line number Diff line number Diff line change 1
1
//! example usage of async tests
2
2
#![ cfg_attr( test, feature( test, custom_test_frameworks) ) ]
3
- #![ cfg_attr( test, test_runner( sweet :: test_runner) ) ]
3
+ #![ cfg_attr( test, test_runner( sweet_test :: test_runner) ) ]
4
4
use anyhow:: Result ;
5
5
6
6
#[ test]
@@ -10,19 +10,19 @@ fn its_ignored_sync() { panic!("foo") }
10
10
#[ should_panic = "cos its fun" ]
11
11
fn it_panics_sync ( ) { panic ! ( "foo" ) }
12
12
13
- #[ sweet :: test]
13
+ #[ sweet_test :: test]
14
14
async fn it_passes ( ) { }
15
- #[ sweet :: test]
15
+ #[ sweet_test :: test]
16
16
async fn it_returns_ok ( ) -> Result < ( ) , String > { Ok ( ( ) ) }
17
17
#[ test]
18
18
#[ ignore = "it returns error" ]
19
19
fn it_returns_err ( ) -> Result < ( ) , String > { Err ( "foo" . to_string ( ) ) }
20
20
21
- #[ sweet :: test]
21
+ #[ sweet_test :: test]
22
22
#[ ignore = "it returns error" ]
23
23
async fn it_returns_err_async ( ) -> Result < ( ) , String > { Err ( "foo" . to_string ( ) ) }
24
24
25
- #[ sweet :: test]
25
+ #[ sweet_test :: test]
26
26
#[ should_panic]
27
27
async fn it_panics ( ) { panic ! ( "foo" ) }
28
28
@@ -34,11 +34,11 @@ async fn it_tokio_waits_then_panics() {
34
34
sweet_core:: sleep_secs ( 1 ) . await ;
35
35
panic ! ( "waddup" )
36
36
}
37
- #[ sweet :: test]
37
+ #[ sweet_test :: test]
38
38
// #[should_panic]
39
39
async fn it_sleeps ( ) { sweet_core:: sleep_secs ( 1 ) . await ; }
40
40
41
- #[ sweet :: test]
41
+ #[ sweet_test :: test]
42
42
#[ should_panic]
43
43
async fn it_sleeps_then_panics ( ) {
44
44
sweet_core:: sleep_secs ( 1 ) . await ;
Original file line number Diff line number Diff line change 1
1
#![ cfg_attr( test, feature( test, custom_test_frameworks) ) ]
2
- #![ cfg_attr( test, test_runner( sweet :: test_runner) ) ]
2
+ #![ cfg_attr( test, test_runner( sweet_test :: test_runner) ) ]
3
3
4
4
5
5
// #[tokio::main]
Original file line number Diff line number Diff line change 1
1
//! example usage of async tests
2
2
#![ cfg_attr( test, feature( test, custom_test_frameworks) ) ]
3
- #![ cfg_attr( test, test_runner( sweet :: test_runner) ) ]
3
+ #![ cfg_attr( test, test_runner( sweet_test :: test_runner) ) ]
4
4
5
5
// ensure we are not nesting runtimes or get this error:
6
6
// Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.
Original file line number Diff line number Diff line change 1
1
//! used for cargo expand
2
2
#![ cfg_attr( test, feature( test, custom_test_frameworks) ) ]
3
- #![ cfg_attr( test, test_runner( sweet :: test_runner) ) ]
3
+ #![ cfg_attr( test, test_runner( sweet_test :: test_runner) ) ]
4
4
5
- #[ sweet :: test]
5
+ #[ sweet_test :: test]
6
6
#[ should_panic]
7
7
async fn it_panics ( ) { panic ! ( "foo" ) }
You can’t perform that action at this time.
0 commit comments