2025-05-03 19:00:41 +02:00
|
|
|
#[cfg(test)]
|
|
|
|
|
use insta::assert_snapshot;
|
|
|
|
|
|
|
|
|
|
pub fn startup_msg() -> String {
|
2025-05-30 15:48:02 +02:00
|
|
|
let authors = env!("CARGO_PKG_AUTHORS");
|
|
|
|
|
let about = about_msg();
|
|
|
|
|
let shorthelp = shorthelp_msg();
|
|
|
|
|
|
|
|
|
|
format!(
|
|
|
|
|
"{about}\n\n\
|
|
|
|
|
Copyright 2025 {authors}. All rights reserved.\n\n\
|
|
|
|
|
{shorthelp}"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-31 15:59:58 +02:00
|
|
|
pub fn version_msg() -> String {
|
2025-05-02 20:35:45 +02:00
|
|
|
let name = env!("CARGO_PKG_NAME");
|
|
|
|
|
let version = env!("CARGO_PKG_VERSION");
|
|
|
|
|
|
2025-05-31 15:59:58 +02:00
|
|
|
format!("{name} v{version}")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn about_msg() -> String {
|
|
|
|
|
let version = version_msg();
|
|
|
|
|
|
2025-05-03 19:00:41 +02:00
|
|
|
format!(
|
2025-05-31 15:59:58 +02:00
|
|
|
"{version} -- A database engine\n\
|
2025-05-30 15:48:02 +02:00
|
|
|
Note: This is experimental software. No maintenance is intendend."
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn shorthelp_msg() -> String {
|
|
|
|
|
String::from(
|
|
|
|
|
"Type .license for licensing information\n\
|
|
|
|
|
Type .help for usage information",
|
2025-05-03 19:00:41 +02:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_startup_msg() {
|
|
|
|
|
assert_snapshot!(startup_msg())
|
2025-05-02 20:35:45 +02:00
|
|
|
}
|