Skip to content

Commit

Permalink
test-helper: Re-export serde_test
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 10, 2023
1 parent a6c880c commit 7448d01
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,5 @@ crossbeam-utils = "0.8"
fastrand = "2"
paste = "1"
quickcheck = { default-features = false, git = "https://github.com/taiki-e/quickcheck.git", branch = "dev" } # https://github.com/BurntSushi/quickcheck/pull/304 + https://github.com/BurntSushi/quickcheck/pull/282 + lower MSRV
serde_test = "1"
sptr = "0.3"
static_assertions = "1"
5 changes: 2 additions & 3 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ LLVM version: 15.0.3",
#[cfg(feature = "serde")]
#[test]
fn test_serde() {
use serde_test::{assert_tokens, Token};
use test_helper::serde::DebugPartialEq;
use test_helper::serde::{assert_tokens, DebugPartialEq, Token};

macro_rules! t {
($atomic_type:ty, $value_type:ident, $token_type:ident) => {
Expand All @@ -346,7 +345,7 @@ fn test_serde() {
t!(AtomicU32, u32, U32);
t!(AtomicI64, i64, I64);
t!(AtomicU64, u64, U64);
// TODO: serde_test doesn't support Token::{I128,U128}
// TODO: serde_test doesn't support Token::{I128,U128}: https://github.com/serde-rs/test/pull/6
// t!(AtomicI128, i128, I128);
// t!(AtomicU128, u128, U128);
#[cfg(feature = "float")]
Expand Down
3 changes: 2 additions & 1 deletion tests/helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ doc = false
test = false

[features]
std = ["critical-section", "fs-err", "serde", "libc", "windows-sys"]
std = ["critical-section", "fs-err", "serde", "serde_test", "libc", "windows-sys"]

[dependencies]
critical-section = { version = "1", optional = true, features = ["restore-state-bool"] }
fs-err = { version = "2", optional = true }
serde = { version = "1", optional = true }
serde_test = { version = "1", optional = true }

[target.'cfg(unix)'.dependencies]
libc = { version = "0.2.140", optional = true }
Expand Down
1 change: 1 addition & 0 deletions tests/helper/src/serde.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::fmt;

use serde::{Deserialize, Serialize};
pub use serde_test::*;

#[derive(Debug)]
pub struct DebugPartialEq<T>(pub T);
Expand Down

0 comments on commit 7448d01

Please sign in to comment.