Skip to content

Commit

Permalink
Update atomic_str.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee authored Jan 22, 2024
1 parent eba3abb commit c57aa22
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/support/src/atomic_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,18 @@ impl fmt::Display for AtomicStr {
f.write_str(&self.as_str())
}
}

#[cfg(test)]
mod tests {
use super::*;

fn test_str(s: &str) {
assert_eq!(s, "hello");
}

#[test]
fn test_atomic_str() {
let s = AtomicStr::from("hello");
test_str(&s.as_str());
}
}

0 comments on commit c57aa22

Please sign in to comment.