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
48
//! # Test Matrix for `Index` Derive
//!
//! This matrix outlines the test cases for the `Index` derive macro.
//!
//! | ID | Struct Type | Fields | Expected Behavior |
//! |-------|-------------|--------|-------------------------------------------------|
//! | I1.1 | Unit | None | Should not compile (Index requires a field) |
//! | I1.2 | Tuple | 1 | Should derive `Index` from the inner field |
//! | I1.3 | Tuple | >1 | Should not compile (Index requires one field) |
//! | I1.4 | Named | 1 | Should derive `Index` from the inner field |
//! | I1.5 | Named | >1 | Should not compile (Index requires one field) |
use test_tools :: *;
use crate the_module Index;
use core ops Index as _;
// I1.1 : Unit struct - should not compile
// #[ derive( Index ) ]
// pub struct UnitStruct;
// I1.2 : Tuple struct with one field
;
// I1.3 : Tuple struct with multiple fields - should not compile
// #[ derive( Index ) ]
// pub struct TupleStruct2( pub i32, pub i32 );
// I1.4 : Named struct with one field
// I1.5 : Named struct with multiple fields - should not compile
// #[ derive( Index ) ]
// pub struct NamedStruct2
// {
// pub field1: i32,
// pub field2: i32,
// }
// Shared test logic
include!;