From b574328d8d8ff1da784846edfcdb64f2f6ad762b Mon Sep 17 00:00:00 2001 From: Jay Bosamiya Date: Fri, 10 Nov 2023 15:41:32 +0530 Subject: [PATCH] Automatically test that syntax-rs is unchanged (#9) --- tests/syntax-rs-unchanged.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/syntax-rs-unchanged.rs diff --git a/tests/syntax-rs-unchanged.rs b/tests/syntax-rs-unchanged.rs new file mode 100644 index 0000000..5cda8fc --- /dev/null +++ b/tests/syntax-rs-unchanged.rs @@ -0,0 +1,14 @@ +//! Testing ../examples/syntax.rs + +use verusfmt::parse_and_format; + +/// Just an automatic test to make sure that ../examples/syntax.rs is left unchanged by verusfmt. +/// +/// This is essentially intended to be a snapshot test, like ./snap-tests.rs, but only as a quick +/// indicator for whether `syntax.rs` has been modified by any change, in order to ensure that +/// `syntax.rs` always in sync with the output that would show up from verusfmt. +#[test] +fn syntax_rs_unchanged() { + let syntax_rs = include_str!("../examples/syntax.rs").to_owned(); + assert_eq!(parse_and_format(&syntax_rs), Ok(syntax_rs)); +}