about summary refs log tree commit diff
path: root/tests/run-make/import-macro-verbatim/verbatim.rs
blob: 0123a4a7e221518911cc137b0c55db4c765ee6bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//! Include a file by concatenating the verbatim path using `/` instead of `\`

include!(concat!(env!("VERBATIM_DIR"), "/include/include.txt"));
fn main() {
    assert_eq!(TEST, "Hello World!");

    let s = include_str!(concat!(env!("VERBATIM_DIR"), "/include/include.txt"));
    assert_eq!(s, "static TEST: &str = \"Hello World!\";\n");

    let b = include_bytes!(concat!(env!("VERBATIM_DIR"), "/include/include.txt"));
    assert_eq!(b, b"static TEST: &str = \"Hello World!\";\n");
}