summaryrefslogtreecommitdiff
path: root/src/tools/suggest-tests/src/tests.rs
blob: 5bc1a7df7ca156a4c8478c169dd11941ba5b7c50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
macro_rules! sugg_test {
    ( $( $name:ident: $paths:expr => $suggestions:expr ),* ) => {
        $(
            #[test]
            fn $name() {
                let suggestions = crate::get_suggestions(&$paths).into_iter().map(|s| s.to_string()).collect::<Vec<_>>();
                assert_eq!(suggestions, $suggestions);
            }
        )*
    };
}

sugg_test! {
    test_error_code_docs: ["compiler/rustc_error_codes/src/error_codes/E0000.md"] =>
        ["check N/A", "test compiler/rustc_error_codes N/A", "test linkchecker 0", "test src/test/ui src/test/run-make 1"],

    test_rustdoc: ["src/librustdoc/src/lib.rs"] => ["test rustdoc 1"],

    test_rustdoc_and_libstd: ["src/librustdoc/src/lib.rs", "library/std/src/lib.rs"] =>
        ["test library/std N/A", "test rustdoc 1"]
}