Skip to content

Commit

Permalink
add a simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
kunicmarko20 committed Mar 6, 2019
1 parent 79a9c7e commit a970cec
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,21 @@ impl<T> ArcGuard<T> {

#[cfg(test)]
mod tests {
use super::ArcGuard;
struct Indicator;

impl Indicator {
pub fn new() -> Self {Indicator}
}

#[test]
fn it_works() {
let indicator = ArcGuard::new(Indicator::new());

let string = indicator.execute(|indicator| -> String {
String::from("5")
});

assert_eq!(string, "5");
}
}

0 comments on commit a970cec

Please sign in to comment.