rust/tests/run-make/rustdoc-determinism/rmake.rs
Nicholas Nethercote 84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00

22 lines
654 B
Rust

// Assert that the search index is generated deterministically, regardless of the
// order that crates are documented in.
use std::path::Path;
use run_make_support::{diff, rustdoc};
fn main() {
let foo_first = Path::new("foo_first");
rustdoc().input("foo.rs").output(&foo_first).run();
rustdoc().input("bar.rs").output(&foo_first).run();
let bar_first = Path::new("bar_first");
rustdoc().input("bar.rs").output(&bar_first).run();
rustdoc().input("foo.rs").output(&bar_first).run();
diff()
.expected_file(foo_first.join("search-index.js"))
.actual_file(bar_first.join("search-index.js"))
.run();
}