Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
e96b4e479a3835d43d3c0bfd1028b5ac9d99cfec
rust/tests/coverage/async_block.rs

20 lines
371 B
Rust
Raw Normal View History

coverage: Add a test for `async` blocks We have coverage tests that use async functions, but none that use async blocks.
2023-12-19 22:17:10 +11:00
#![feature(coverage_attribute)]
#![feature(noop_waker)]
[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives
2024-02-22 12:10:29 +00:00
//@ edition: 2021
coverage: Add a test for `async` blocks We have coverage tests that use async functions, but none that use async blocks.
2023-12-19 22:17:10 +11:00
coverage: Extract `executor::block_on` from several async coverage tests By moving `block_on` to an auxiliary crate, we avoid having to keep a separate copy of it in every async test. (This also incorporates some small tweaks to the headers in `await_ready.rs`.)
2024-09-06 15:41:10 +10:00
//@ aux-build: executor.rs
extern crate executor;
coverage: Add a test for `async` blocks We have coverage tests that use async functions, but none that use async blocks.
2023-12-19 22:17:10 +11:00
fn main() {
for i in 0..16 {
let future = async {
if i >= 12 {
println!("big");
} else {
println!("small");
}
};
executor::block_on(future);
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 155ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API