mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-28 13:00:26 +00:00
Add test for borrowed LinearMap
key.
This commit is contained in:
parent
64fee10a3b
commit
628eed6cd5
@ -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() {
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user