#[tokio::test] asyncfn open_options_write() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().write(true)).contains("write: true"));
}
#[tokio::test] asyncfn open_options_append() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().append(true)).contains("append: true"));
}
#[tokio::test] asyncfn open_options_truncate() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().truncate(true)).contains("truncate: true"));
}
#[tokio::test] asyncfn open_options_create() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().create(true)).contains("create: true"));
}
#[tokio::test] asyncfn open_options_create_new() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().create_new(true)).contains("create_new: true"));
}
#[tokio::test] #[cfg(unix)] asyncfn open_options_mode() { let mode = format!("{:?}", OpenOptions::new().mode(0o644)); // TESTING HACK: use Debug output to check the stored data
assert!(
mode.contains("mode: 420 ") || mode.contains("mode: 0o000644 "), "mode is: {}",
mode
);
}
#[tokio::test] #[cfg(target_os = "linux")] asyncfn open_options_custom_flags_linux() { // TESTING HACK: use Debug output to check the stored data
assert!(
format!("{:?}", OpenOptions::new().custom_flags(libc::O_TRUNC))
.contains("custom_flags: 512,")
);
}
#[tokio::test] #[cfg(any(target_os = "freebsd", target_os = "macos"))] asyncfn open_options_custom_flags_bsd_family() { // TESTING HACK: use Debug output to check the stored data
assert!(
format!("{:?}", OpenOptions::new().custom_flags(libc::O_NOFOLLOW))
.contains("custom_flags: 256,")
);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-19)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.