| 117 | |
| 118 | #[test] |
| 119 | fn test_field_value_conversion() { |
| 120 | // Test integer conversion |
| 121 | let int_value = FieldValue::Int(42); |
| 122 | let proto_value: proto::FieldValue = int_value.clone().into(); |
| 123 | let converted_back: FieldValue = proto_value.try_into().unwrap(); |
| 124 | assert!(matches!(converted_back, FieldValue::Int(42))); |
| 125 | |
| 126 | // Test string conversion |
| 127 | let string_value = FieldValue::String("test".to_string()); |
| 128 | let proto_value: proto::FieldValue = string_value.clone().into(); |
| 129 | let converted_back: FieldValue = proto_value.try_into().unwrap(); |
| 130 | assert!(matches!(converted_back, FieldValue::String(s) if s == "test")); |
| 131 | |
| 132 | // Test empty value |
| 133 | let empty_value = proto::FieldValue { value: None }; |
| 134 | assert!(FieldValue::try_from(empty_value).is_err()); |
| 135 | } |
| 136 | |
| 137 | #[test] |
| 138 | fn test_metadata_field_conversion() { |