Skip to content

Commit

Permalink
Add clear_without_value test
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard-W committed Feb 5, 2019
1 parent 254dee2 commit 84f01ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,13 @@ mod tests {
assert!(!LateStatic::is_assigned(&CLEAR_TEST));
}
}

static mut CLEAR_WITHOUT_VALUE: LateStatic<Foo> = LateStatic::new();
#[test]
#[should_panic]
fn clear_without_value() {
unsafe {
LateStatic::clear(&CLEAR_WITHOUT_VALUE);
}
}
}

0 comments on commit 84f01ff

Please sign in to comment.