Files
mitsuhiko-insta/insta/tests/test_binary.rs
T
dualfroz bd404ed8a5 Remove trailing semicolon from assert_binary_snapshot! macro body
#940 removed the trailing semicolons from the serialization macro bodies but missed the two-argument arm of assert_binary_snapshot!, so calling it at the end of a block still warns with semicolon_in_expressions_from_non_local_macros on newer toolchains. this drops that semicolon and the one in test_binary.rs, so the test covers it.
2026-10-07 20:11:30 +02:00

33 lines
871 B
Rust

#[test]
fn test_binary_snapshot() {
insta::assert_binary_snapshot!(".txt", b"test".to_vec())
}
#[test]
#[should_panic(expected = "'.new' is not allowed as a file extension")]
fn test_new_extension() {
insta::assert_binary_snapshot!(".new", b"test".to_vec());
}
#[test]
#[should_panic(expected = "\"test\" does not match the format \"name.extension\"")]
fn test_malformed_name_and_extension() {
insta::assert_binary_snapshot!("test", b"test".to_vec());
}
#[test]
#[should_panic(expected = "file extensions starting with 'new.' are not allowed")]
fn test_extension_starting_with_new() {
insta::assert_binary_snapshot!(".new.gz", b"test".to_vec());
}
#[test]
fn test_multipart_extension() {
insta::assert_binary_snapshot!(".tar.gz", b"test".to_vec());
}
#[test]
fn test_named() {
insta::assert_binary_snapshot!("name.json", b"null".to_vec());
}