mirror of
https://gitee.com/openharmony/commonlibrary_rust_ylong_runtime
synced 2024-10-07 03:54:05 +00:00
gn添加测试feature,修复测试会出现换行符的问题
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
This commit is contained in:
parent
b222404168
commit
5d7d79c29f
@ -43,6 +43,7 @@ ohos_rust_systemtest("rust_ylong_runtime_test_sdv") {
|
||||
"--cfg=feature=\"fs\"",
|
||||
"--cfg=feature=\"macros\"",
|
||||
"--cfg=feature=\"net\"",
|
||||
"--cfg=feature=\"process\"",
|
||||
"--cfg=feature=\"sync\"",
|
||||
"--cfg=feature=\"signal\"",
|
||||
"--cfg=feature=\"time\"",
|
||||
|
@ -107,7 +107,8 @@ fn sdv_process_child_stdio_test1() {
|
||||
let stdout_handle = ylong_runtime::spawn(async move {
|
||||
let mut buf = Vec::new();
|
||||
stdout.read_to_end(&mut buf).await.unwrap();
|
||||
assert_eq!(buf.as_slice(), b"!dlrow ,olleH");
|
||||
let str = "!dlrow ,olleH";
|
||||
assert!(String::from_utf8(buf).unwrap().contains(str));
|
||||
});
|
||||
|
||||
let mut stderr = child.take_stderr().expect("Failed to open stderr");
|
||||
@ -159,7 +160,8 @@ fn sdv_process_child_stdio_test2() {
|
||||
let stdout_handle = ylong_runtime::spawn(async move {
|
||||
let mut buf = Vec::new();
|
||||
stdout.read_to_end(&mut buf).await.unwrap();
|
||||
assert_eq!(buf.as_slice(), b"!dlrow ,olleH");
|
||||
let str = "!dlrow ,olleH";
|
||||
assert!(String::from_utf8(buf).unwrap().contains(str));
|
||||
});
|
||||
|
||||
let mut stderr = child.take_stderr().expect("Failed to open stderr");
|
||||
@ -211,7 +213,7 @@ fn sdv_process_try_wait_test() {
|
||||
let mut child = command.spawn().unwrap();
|
||||
|
||||
loop {
|
||||
if let Some(_) = child.try_wait().unwrap() {
|
||||
if child.try_wait().unwrap().is_some() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user