Added veilid_log tests.

This commit is contained in:
Teknique 2023-05-31 16:26:28 -07:00
parent 04c52a4ddb
commit febd5fe2dd

View File

@ -187,7 +187,22 @@ pub async fn test_partialtunnel() {
assert_eq!(orig, copy);
}
pub async fn test_veilidloglevel() {
let orig = VeilidLogLevel::Info;
let copy = deserialize_json(&serialize_json(&orig)).unwrap();
assert_eq!(orig, copy);
}
pub async fn test_veilidlog() {
let orig = VeilidLog {
log_level: VeilidLogLevel::Debug,
message: "A log! A log!".to_string(),
backtrace: Some("Func1 -> Func2 -> Func3".to_string()),
};
let copy = deserialize_json(&serialize_json(&orig)).unwrap();
assert_eq!(orig, copy);
}
pub async fn test_all() {
test_round_trip_peerinfo().await;
test_alignedu64().await;
@ -204,4 +219,6 @@ pub async fn test_all() {
test_tunnelendpoint().await;
test_fulltunnel().await;
test_partialtunnel().await;
test_veilidloglevel().await;
test_veilidlog().await;
}