1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! # Test Matrix for `Not` Derive
//!
//! This matrix outlines the test cases for the `Not` derive macro.
//!
//! | ID | Struct Type | Fields | Expected Behavior |
//! |-------|-------------|--------|-------------------------------------------------|
//! | N1.1 | Unit | None | Should derive `Not` for unit structs |
//! | N1.2 | Tuple | 1 | Should derive `Not` for tuple structs with one field |
//! | N1.3 | Tuple | >1 | Should not compile (Not requires one field) |
//! | N1.4 | Named | 1 | Should derive `Not` for named structs with one field |
//! | N1.5 | Named | >1 | Should not compile (Not requires one field) |
#[ allow( unused_imports ) ]
#[ allow( dead_code ) ]
use test_tools :: *;
use crate ::the_module ::Not;
// N1.1 : Unit struct
#[ derive( Not ) ]
pub struct UnitStruct;
// N1.2 : Tuple struct with one field
#[ derive( Not ) ]
pub struct TupleStruct1( pub bool );
// N1.3 : Tuple struct with multiple fields - should not compile
// #[ derive( Not ) ]
// pub struct TupleStruct2( pub bool, pub bool );
// N1.4 : Named struct with one field
#[ derive( Not ) ]
pub struct NamedStruct1
{
pub field1: bool,
}
// N1.5 : Named struct with multiple fields - should not compile
// #[ derive( Not ) ]
// pub struct NamedStruct2
// {
// pub field1: bool,
// pub field2: bool,
// }
// Shared test logic
include!( "../not_only_test.rs" );