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
//! Verification test for readme.md example code
//!
//! This test ensures that the example code shown in readme.md actually compiles
//! and runs correctly. This prevents documentation drift.
#[cfg(test)]
mod readme_example_tests
{
/// Test the basic example from readme.md
#[ test ]
fn test_readme_basic_example()
{
// This is the exact code from readme.md lines 78-106
#[ cfg( feature = "enabled" ) ]
#[ cfg( not( feature = "no_std" ) ) ]
tests_impls!
{
fn pass1()
{
assert_eq!( true, true );
}
//
fn pass2()
{
assert_eq!( 1, 1 );
}
}
//
#[ cfg( feature = "enabled" ) ]
#[ cfg( not( feature = "no_std" ) ) ]
tests_index!
{
pass1,
pass2,
}
// If we got here, the macros work correctly
}
}