TEST: Fix tests with no-std

This commit is contained in:
bluss 2018-12-16 14:30:53 +01:00
parent 7036a1dd06
commit 30ca6981fb
2 changed files with 6 additions and 0 deletions

View File

@ -15,5 +15,6 @@ branches:
script:
- |
cargo build --no-default-features &&
cargo test --no-default-features &&
cargo build &&
cargo test

View File

@ -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);