MCPcopy Create free account
hub / github.com/carllerche/assert-struct / test_basic_method_calls

Function test_basic_method_calls

assert-struct/tests/method_calls.rs:18–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17#[test]
18fn test_basic_method_calls() {
19 let data = TestData {
20 text: "hello world".to_string(),
21 numbers: vec![1, 2, 3],
22 maybe_value: Some("test".to_string()),
23 result_value: Ok(42),
24 map: {
25 let mut m = HashMap::new();
26 m.insert("key1".to_string(), 10);
27 m.insert("key2".to_string(), 20);
28 m
29 },
30 tuple_data: (
31 vec!["a".to_string(), "b".to_string()],
32 "middle".to_string(),
33 Some(99),
34 ),
35 };
36
37 // Test basic method calls
38 assert_struct!(data, TestData {
39 text.len(): 11,
40 numbers.len(): 3,
41 maybe_value.is_some(): true,
42 result_value.is_ok(): true,
43 map.len(): 2,
44 ..
45 });
46}
47
48#[test]
49fn test_tuple_method_calls() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected