chrono/tests/win_bindings.rs
2025-01-07 20:34:23 +01:00

22 lines
701 B
Rust

#![cfg(all(windows, feature = "clock", feature = "std"))]
use std::fs;
use windows_bindgen::bindgen;
#[test]
fn gen_bindings() {
let input = "src/offset/local/win_bindings.txt";
let output = "src/offset/local/win_bindings.rs";
let existing = fs::read_to_string(output).unwrap();
bindgen(["--etc", input]);
// Check the output is the same as before.
// Depending on the git configuration the file may have been checked out with `\r\n` newlines or
// with `\n`. Compare line-by-line to ignore this difference.
let new = fs::read_to_string(output).unwrap();
if !new.lines().eq(existing.lines()) {
panic!("generated file `{}` is changed.", output);
}
}