| 69 | } |
| 70 | |
| 71 | fn test_record_roundtrip() { |
| 72 | let mut values = NamesById::new(); |
| 73 | values.insert(10, "ten".to_string()); |
| 74 | values.insert(20, "twenty".to_string()); |
| 75 | let entry = LabeledEntry { |
| 76 | label: "test-label".to_string(), |
| 77 | values, |
| 78 | }; |
| 79 | let result = record_roundtrip(&entry); |
| 80 | assert_eq!(result.label, "test-label"); |
| 81 | assert_eq!(result.values.len(), 2); |
| 82 | assert_eq!(result.values.get(&10).map(String::as_str), Some("ten")); |
| 83 | assert_eq!(result.values.get(&20).map(String::as_str), Some("twenty")); |
| 84 | } |
| 85 | |
| 86 | fn test_inline_roundtrip() { |
| 87 | let mut input = wit_bindgen::rt::Map::new(); |