Update test suite to 2018 edition

This commit is contained in:
David Tolnay 2018-12-31 21:44:24 -05:00
parent da346a8878
commit 294dccc5be
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
14 changed files with 23 additions and 68 deletions

View File

@ -2,6 +2,7 @@
name = "serde_test_suite"
version = "0.0.0"
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
edition = "2018"
publish = false
[features]
@ -11,7 +12,7 @@ compiletest = ["compiletest_rs"]
[dev-dependencies]
fnv = "1.0"
rustc-serialize = "0.3.16"
serde = { path = "../serde", features = ["rc"] }
serde = { path = "../serde", features = ["rc", "derive"] }
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
serde_test = { path = "../serde_test" }

View File

@ -1,6 +1,6 @@
#![cfg(feature = "compiletest")]
extern crate compiletest_rs as compiletest;
use compiletest_rs as compiletest;
#[test]
fn ui() {

View File

@ -1,19 +1,14 @@
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
#[macro_use]
extern crate serde_derive;
extern crate serde;
use self::serde::de::{self, MapAccess, Unexpected, Visitor};
use self::serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde::de::{self, MapAccess, Unexpected, Visitor};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::collections::{BTreeMap, HashMap};
use std::fmt;
use std::marker::PhantomData;
extern crate serde_test;
use self::serde_test::{
use serde_test::{
assert_de_tokens, assert_de_tokens_error, assert_ser_tokens, assert_ser_tokens_error,
assert_tokens, Token,
};

View File

@ -1,10 +1,4 @@
#[macro_use]
extern crate serde_derive;
extern crate serde;
use serde::{Deserialize, Deserializer};
extern crate serde_test;
use serde_test::{assert_de_tokens, assert_de_tokens_error, Token};
use std::borrow::Cow;

View File

@ -2,9 +2,6 @@
#![cfg_attr(feature = "cargo-clippy", allow(decimal_literal_representation))]
#![cfg_attr(feature = "unstable", feature(never_type))]
#[macro_use]
extern crate serde_derive;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::default::Default;
use std::ffi::{CStr, CString, OsString};
@ -15,14 +12,9 @@ use std::rc::{Rc, Weak as RcWeak};
use std::sync::{Arc, Weak as ArcWeak};
use std::time::{Duration, UNIX_EPOCH};
extern crate serde;
use fnv::FnvHasher;
use serde::{Deserialize, Deserializer};
extern crate fnv;
use self::fnv::FnvHasher;
extern crate serde_test;
use self::serde_test::{assert_de_tokens, assert_de_tokens_error, Configure, Token};
use serde_test::{assert_de_tokens, assert_de_tokens_error, Configure, Token};
#[macro_use]
mod macros;

View File

@ -5,12 +5,8 @@
#![deny(warnings)]
#![cfg_attr(feature = "unstable", feature(non_ascii_idents))]
#[macro_use]
extern crate serde_derive;
extern crate serde;
use self::serde::de::{DeserializeOwned, Deserializer};
use self::serde::ser::{Serialize, Serializer};
use serde::de::DeserializeOwned;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::borrow::Cow;
use std::marker::PhantomData;
@ -384,6 +380,8 @@ fn test_gen() {
}
mod vis {
use serde::{Deserialize, Serialize};
pub struct S;
#[derive(Serialize, Deserialize)]
@ -607,6 +605,8 @@ fn test_gen() {
mod restricted {
mod inner {
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct Restricted {
pub(super) a: usize,

View File

@ -1,7 +1,4 @@
#[macro_use]
extern crate serde_derive;
extern crate serde_test;
use serde::Deserialize;
use serde_test::{assert_de_tokens, Token};
#[test]

View File

@ -2,15 +2,10 @@
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_test;
mod bytes;
use self::serde_test::{
use serde::{Deserialize, Serialize};
use serde_test::{
assert_de_tokens, assert_de_tokens_error, assert_ser_tokens, assert_tokens, Token,
};

View File

@ -1,8 +1,7 @@
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]
#[macro_use]
extern crate serde_derive;
use serde::{Deserialize, Serialize};
mod remote {
pub struct Unit;

View File

@ -1,5 +1,4 @@
extern crate serde_test;
use self::serde_test::{assert_tokens, Configure, Token};
use serde_test::{assert_tokens, Configure, Token};
use std::net;

View File

@ -1,8 +1,5 @@
#![cfg_attr(feature = "unstable", feature(never_type))]
#[macro_use]
extern crate serde_derive;
use std::cell::RefCell;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::ffi::CString;
@ -17,11 +14,9 @@ use std::time::{Duration, UNIX_EPOCH};
#[cfg(unix)]
use std::str;
extern crate serde_test;
use self::serde_test::{assert_ser_tokens, assert_ser_tokens_error, Configure, Token};
extern crate fnv;
use self::fnv::FnvHasher;
use fnv::FnvHasher;
use serde::Serialize;
use serde_test::{assert_ser_tokens, assert_ser_tokens_error, Configure, Token};
#[macro_use]
mod macros;

View File

@ -1,14 +1,5 @@
#![deny(warnings)]
#[cfg(feature = "unstable")]
#[macro_use]
extern crate serde_derive;
#[cfg(feature = "unstable")]
extern crate serde;
#[cfg(feature = "unstable")]
extern crate serde_test;
// This test target is convoluted with the actual #[test] in a separate file to
// get it so that the stable compiler does not need to parse the code of the
// test. If the test were written with #[cfg(feature = "unstable")] #[test]

View File

@ -1,7 +1,3 @@
#[macro_use]
extern crate serde_derive;
extern crate serde;
use serde::de::{value, IntoDeserializer};
use serde::Deserialize;

View File

@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use serde_test::{assert_tokens, Token};
#[test]