test: ensure startup message is correct
This commit is contained in:
parent
6910407ad2
commit
7fbaec8743
7 changed files with 200 additions and 7 deletions
|
|
@ -1,8 +1,18 @@
|
|||
pub fn startup_msg() {
|
||||
#[cfg(test)]
|
||||
use insta::assert_snapshot;
|
||||
|
||||
pub fn startup_msg() -> String {
|
||||
let name = env!("CARGO_PKG_NAME");
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
let authors = env!("CARGO_PKG_AUTHORS");
|
||||
|
||||
println!("{name} v{version} started.",);
|
||||
println!("Copyright 2025 {authors}. All rights reserved.")
|
||||
format!(
|
||||
"{name} v{version} started.\n\
|
||||
Copyright 2025 {authors}. All rights reserved."
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_startup_msg() {
|
||||
assert_snapshot!(startup_msg())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue