Add test for borrowed LinearMap key.

This commit is contained in:
Markus Reiter 2025-03-28 10:52:19 +01:00
parent 64fee10a3b
commit 628eed6cd5
No known key found for this signature in database

View File

@ -570,6 +570,18 @@ mod test {
static mut _L: LinearMap<i32, i32, 8> = LinearMap::new();
}
#[test]
fn borrow() {
use crate::String;
let mut map = LinearMap::<_, _, 8>::new();
let s = String::<64>::try_from("Hello, world!").unwrap();
map.insert(s, 42).unwrap();
assert_eq!(map.get("Hello, world!").unwrap(), &42);
}
#[test]
fn partial_eq() {
{