Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
12 lines
323 B
12 lines
323 B
use debug_proto::DebugMsg; |
|
use googletest::prelude::*; |
|
|
|
#[test] |
|
fn test_debug() { |
|
let mut msg = DebugMsg::new(); |
|
msg.set_id(1); |
|
msg.set_secret_user_data("password"); |
|
|
|
assert_that!(format!("{msg:?}"), contains_substring("id: 1")); |
|
assert_that!(format!("{msg:?}"), not(contains_substring("password"))); |
|
}
|
|
|