diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-12-31 17:57:30 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-31 17:57:30 +0000 |
| commit | 0be9b0599aaf2e425d76ec7852ff4b3535defddf (patch) | |
| tree | e308dcfc94b12cba17487c4a4f4e7449e8935c41 /embassy-executor/tests/test.rs | |
| parent | 430696802e31701f23d2c8e9d5fc8c796cf277e1 (diff) | |
| parent | 2efde24f333cdf1730f14c050460eb7e0c44f5b9 (diff) | |
Merge pull request #2380 from MabezDev/cfg-task-args
Extend the task macro to allow cfging arguments away
Diffstat (limited to 'embassy-executor/tests/test.rs')
| -rw-r--r-- | embassy-executor/tests/test.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/embassy-executor/tests/test.rs b/embassy-executor/tests/test.rs index 0dbd391e8..2c2441dd5 100644 --- a/embassy-executor/tests/test.rs +++ b/embassy-executor/tests/test.rs | |||
| @@ -135,3 +135,17 @@ fn executor_task_self_wake_twice() { | |||
| 135 | ] | 135 | ] |
| 136 | ) | 136 | ) |
| 137 | } | 137 | } |
| 138 | |||
| 139 | #[test] | ||
| 140 | fn executor_task_cfg_args() { | ||
| 141 | // simulate cfg'ing away argument c | ||
| 142 | #[task] | ||
| 143 | async fn task1(a: u32, b: u32, #[cfg(any())] c: u32) { | ||
| 144 | let (_, _) = (a, b); | ||
| 145 | } | ||
| 146 | |||
| 147 | #[task] | ||
| 148 | async fn task2(a: u32, b: u32, #[cfg(all())] c: u32) { | ||
| 149 | let (_, _, _) = (a, b, c); | ||
| 150 | } | ||
| 151 | } | ||
