include_tt 1.1.1

Macros for ultra-flexible injection of token trees, literals, or binary data into Rust code from external files during compilation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use include_tt::inject;

#[test]
fn test_fix_unktoken() {
    #[allow(unused_assignments)] // bug?
    let mut b = 20;
    assert_eq!("\\".len(), 1);
    inject! {
        // File contains: `\ b = 30; \`
        #ctt("./tests/invalid_token.tt")
    }

    assert_eq!(b, 30);
}