mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-14 02:21:01 +00:00
Add run-pass test for expansion info
This commit is contained in:
@@ -21,6 +21,7 @@ clippy = { version = "^0.*", optional = true }
|
|||||||
serde_codegen = { version = "^0.7.12", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
serde_codegen = { version = "^0.7.12", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
clippy = "^0.0.78"
|
||||||
compiletest_rs = "^0.2.0"
|
compiletest_rs = "^0.2.0"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
rustc-serialize = "^0.3.16"
|
rustc-serialize = "^0.3.16"
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ fn run_mode(mode: &'static str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn compile_test() {
|
fn compile_fail() {
|
||||||
run_mode("compile-fail");
|
run_mode("compile-fail");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn run_pass() {
|
||||||
|
run_mode("run-pass");
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#![feature(custom_derive, plugin)]
|
||||||
|
#![plugin(serde_macros, clippy)]
|
||||||
|
|
||||||
|
#![deny(identity_op)]
|
||||||
|
|
||||||
|
// The derived implementation uses 0+1 to add up the number of fields
|
||||||
|
// serialized, which Clippy warns about. If the expansion info is registered
|
||||||
|
// correctly, the Clippy lint is not triggered.
|
||||||
|
#[derive(Serialize)]
|
||||||
|
struct A { b: u8 }
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
Reference in New Issue
Block a user