MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / test_option_roundtrip

Function test_option_roundtrip

tests/runtime/map/runner.rs:61–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61fn test_option_roundtrip() {
62 let mut input = wit_bindgen::rt::Map::new();
63 input.insert("some".to_string(), Some(42));
64 input.insert("none".to_string(), None);
65 let result = option_roundtrip(&input);
66 assert_eq!(result.len(), 2);
67 assert_eq!(result.get("some"), Some(&Some(42)));
68 assert_eq!(result.get("none"), Some(&None));
69}
70
71fn test_record_roundtrip() {
72 let mut values = NamesById::new();

Callers 1

runMethod · 0.70

Calls 3

newFunction · 0.85
insertMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected