Skip to content

Commit

Permalink
Set up a pseudo-module for sync-and-unsync tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhenrymantilla committed Jun 2, 2023
1 parent 8f39b77 commit c9975f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/it.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/// Put here any code relying on duck-typed `Lazy` and `OnceCell`, oblivious to
/// their exact `sync` or `unsync` nature.
macro_rules! tests_for_both {
() => {
/* TODO */
};
}

mod unsync {
use core::{
cell::Cell,
Expand All @@ -6,6 +14,8 @@ mod unsync {

use once_cell::unsync::{Lazy, OnceCell};

tests_for_both!();

#[test]
fn once_cell() {
let c = OnceCell::new();
Expand Down Expand Up @@ -263,6 +273,8 @@ mod sync {

use once_cell::sync::{Lazy, OnceCell};

tests_for_both!();

#[test]
fn once_cell() {
let c = OnceCell::new();
Expand Down

0 comments on commit c9975f3

Please sign in to comment.