Dever v0.0.2
This commit is contained in:
commit
e6e175ebcf
816 files changed
+120349
No files matched your search
@@ -0,0 +1,18 @@
|
||||
use std::ffi::OsString;
|
||||
let expected = std::env::args_os().skip(1).map(OsString::into_string).collect::<Result<Vec<_>, _>>();
|
||||
if let Ok(expected) = expected {
|
||||
assert_eq!(@readArgs@().unwrap(), expected);
|
||||
assert_eq!(dever_runtime::task::run(true, 1, async |scope| @throughTask@(scope).await).unwrap().unwrap(), expected);
|
||||
@allocation_counter@
|
||||
let before = ALLOCATIONS.load(Ordering::Relaxed);
|
||||
let direct = std::env::args_os().skip(1).map(OsString::into_string).collect::<Result<Vec<_>, _>>().unwrap();
|
||||
let direct_allocations = ALLOCATIONS.load(Ordering::Relaxed) - before;
|
||||
let before = ALLOCATIONS.load(Ordering::Relaxed);
|
||||
let generated = @readArgs@().unwrap();
|
||||
let generated_allocations = ALLOCATIONS.load(Ordering::Relaxed) - before;
|
||||
assert_eq!(generated, direct);
|
||||
assert_eq!(generated_allocations, direct_allocations, "boundary must not copy argument strings");
|
||||
} else {
|
||||
let error = @readArgs@().unwrap_err();
|
||||
assert!(matches!(error, Failure::@ArgumentsResult@(@ArgumentsResult@::Failed(message)) if message == "process argument is not UTF-8"));
|
||||
}
|
||||
Reference in new issue
Block a user