Stabilize some unstable tests in test suite

This commit is contained in:
David Tolnay 2018-06-03 00:27:26 -07:00
parent bd366f675e
commit 94853752a1
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 41 additions and 60 deletions

View File

@ -14,7 +14,7 @@ extern crate serde_derive;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::default::Default;
use std::ffi::{CString, OsString};
use std::ffi::{CStr, CString, OsString};
use std::net;
use std::num::Wrapping;
use std::path::{Path, PathBuf};
@ -22,9 +22,6 @@ use std::rc::{Rc, Weak as RcWeak};
use std::sync::{Arc, Weak as ArcWeak};
use std::time::{Duration, UNIX_EPOCH};
#[cfg(feature = "unstable")]
use std::ffi::CStr;
extern crate serde;
use serde::{Deserialize, Deserializer};
@ -866,6 +863,26 @@ declare_tests! {
Token::U64(1),
],
}
test_rc_dst {
Rc::<str>::from("s") => &[
Token::Str("s"),
],
Rc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
test_arc_dst {
Arc::<str>::from("s") => &[
Token::Str("s"),
],
Arc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
}
declare_tests! {
@ -961,30 +978,6 @@ declare_tests! {
}
}
#[cfg(feature = "unstable")]
declare_tests! {
test_rc_dst {
Rc::<str>::from("s") => &[
Token::Str("s"),
],
Rc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
test_arc_dst {
Arc::<str>::from("s") => &[
Token::Str("s"),
],
Arc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
}
#[cfg(feature = "unstable")]
declare_tests! {
test_never_result {
@ -1035,7 +1028,6 @@ fn test_osstring() {
assert_de_tokens_ignore(&tokens);
}
#[cfg(feature = "unstable")]
#[test]
fn test_cstr() {
assert_de_tokens::<Box<CStr>>(
@ -1044,7 +1036,6 @@ fn test_cstr() {
);
}
#[cfg(feature = "unstable")]
#[test]
fn test_cstr_internal_null() {
assert_de_tokens_error::<Box<CStr>>(
@ -1053,7 +1044,6 @@ fn test_cstr_internal_null() {
);
}
#[cfg(feature = "unstable")]
#[test]
fn test_cstr_internal_null_end() {
assert_de_tokens_error::<Box<CStr>>(

View File

@ -297,11 +297,9 @@ fn test_gen() {
f: u8,
}
#[cfg(feature = "unstable")]
#[derive(Serialize, Deserialize)]
struct EmptyTuple();
#[cfg(feature = "unstable")]
#[derive(Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
struct EmptyTupleDenyUnknown();
@ -327,7 +325,6 @@ fn test_gen() {
Variant,
}
#[cfg(feature = "unstable")]
#[derive(Serialize, Deserialize)]
enum EmptyVariants {
Braced {},
@ -339,7 +336,6 @@ fn test_gen() {
TupleSkip(#[serde(skip_deserializing)] u8),
}
#[cfg(feature = "unstable")]
#[derive(Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
enum EmptyVariantsDenyUnknown {

View File

@ -442,6 +442,26 @@ declare_tests! {
Token::U64(1),
],
}
test_rc_dst {
Rc::<str>::from("s") => &[
Token::Str("s"),
],
Rc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
test_arc_dst {
Arc::<str>::from("s") => &[
Token::Str("s"),
],
Arc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
}
declare_tests! {
@ -525,31 +545,6 @@ declare_tests! {
}
}
// Serde's implementation is not unstable, but the constructors are.
#[cfg(feature = "unstable")]
declare_tests! {
test_rc_dst {
Rc::<str>::from("s") => &[
Token::Str("s"),
],
Rc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
test_arc_dst {
Arc::<str>::from("s") => &[
Token::Str("s"),
],
Arc::<[bool]>::from(&[true][..]) => &[
Token::Seq { len: Some(1) },
Token::Bool(true),
Token::SeqEnd,
],
}
}
#[cfg(feature = "unstable")]
declare_tests! {
test_never_result {