|
|
|
@ -9,20 +9,6 @@ use googletest::prelude::*; |
|
|
|
|
|
|
|
|
|
use unittest_rust_proto::{TestAllTypes, TestCord}; |
|
|
|
|
|
|
|
|
|
#[gtest] |
|
|
|
|
fn test_string_cord() { |
|
|
|
|
let mut msg = TestAllTypes::new(); |
|
|
|
|
assert_that!(msg.has_optional_cord(), eq(false)); |
|
|
|
|
assert_that!(msg.optional_cord(), eq("")); |
|
|
|
|
msg.set_optional_cord("hello"); |
|
|
|
|
assert_that!(msg.has_optional_cord(), eq(true)); |
|
|
|
|
assert_that!(msg.optional_cord(), eq("hello")); |
|
|
|
|
|
|
|
|
|
let mut msg2 = TestAllTypes::new(); |
|
|
|
|
msg2.set_optional_cord(msg.optional_cord()); |
|
|
|
|
assert_that!(msg2.optional_cord(), eq("hello")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[gtest] |
|
|
|
|
fn test_bytes_cord() { |
|
|
|
|
let mut msg = TestCord::new(); |
|
|
|
|