Add run-pass test for expansion info
This commit is contained in:
parent
149c87d7c2
commit
a3a7e4085f
@ -21,6 +21,7 @@ clippy = { version = "^0.*", optional = true }
|
||||
serde_codegen = { version = "^0.7.12", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
||||
|
||||
[dev-dependencies]
|
||||
clippy = "^0.0.78"
|
||||
compiletest_rs = "^0.2.0"
|
||||
fnv = "1.0"
|
||||
rustc-serialize = "^0.3.16"
|
||||
|
@ -20,6 +20,11 @@ fn run_mode(mode: &'static str) {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compile_test() {
|
||||
fn compile_fail() {
|
||||
run_mode("compile-fail");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn run_pass() {
|
||||
run_mode("run-pass");
|
||||
}
|
||||
|
12
serde_macros/tests/run-pass/identity-op.rs
Normal file
12
serde_macros/tests/run-pass/identity-op.rs
Normal file
@ -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() {}
|
Loading…
x
Reference in New Issue
Block a user