mirror of
https://gitee.com/openharmony/third_party_rust_scopeguard
synced 2024-11-23 06:30:18 +00:00
TEST: Fix tests with no-std
This commit is contained in:
parent
7036a1dd06
commit
30ca6981fb
@ -15,5 +15,6 @@ branches:
|
||||
script:
|
||||
- |
|
||||
cargo build --no-default-features &&
|
||||
cargo test --no-default-features &&
|
||||
cargo build &&
|
||||
cargo test
|
||||
|
@ -374,6 +374,7 @@ mod tests {
|
||||
assert_eq!(drops.get(), 0);
|
||||
}
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
#[test]
|
||||
fn test_defer_success_1() {
|
||||
let drops = Cell::new(0);
|
||||
@ -384,6 +385,7 @@ mod tests {
|
||||
assert_eq!(drops.get(), 1);
|
||||
}
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
#[test]
|
||||
fn test_defer_success_2() {
|
||||
let drops = Cell::new(0);
|
||||
@ -394,6 +396,7 @@ mod tests {
|
||||
assert_eq!(drops.get(), 0);
|
||||
}
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
#[test]
|
||||
fn test_defer_unwind_1() {
|
||||
let drops = Cell::new(0);
|
||||
@ -405,6 +408,7 @@ mod tests {
|
||||
assert_eq!(drops.get(), 1);
|
||||
}
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
#[test]
|
||||
fn test_defer_unwind_2() {
|
||||
let drops = Cell::new(0);
|
||||
@ -427,6 +431,7 @@ mod tests {
|
||||
assert_eq!(closure_drops.get(), 1);
|
||||
}
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
#[test]
|
||||
fn test_dropped_once_when_not_run() {
|
||||
let value_drops = Cell::new(0);
|
||||
|
Loading…
Reference in New Issue
Block a user