ockam_node_test_attribute 0.5.0

Ockam node attribute proc_macros.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[test]
fn trybuild() {
    #[cfg(feature = "std")]
    {
        // `node` macro tests
        let t = trybuild::TestCases::new();
        t.compile_fail("tests/node/fail*.rs");
        t.pass("tests/node/pass*.rs");

        // `node_test` macro tests
        t.compile_fail("tests/node_test/fail*.rs");
        // When the node_test macro is compiled successfully, it will return the error "the main function doesn't exist" because this macro
        // is only valid within a test context. Therefore, the "pass" tests is considered valid if it returns only that error.
        t.compile_fail("tests/node_test/pass*.rs");
    };
}