From: Ian Jackson Date: Fri, 15 Nov 2024 16:24:32 +0000 (+0000) Subject: test prepend X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=22bcb423241931ac331ac2ff2afc273ae0f38640;p=manually-boxed test prepend --- diff --git a/src/test.rs b/src/test.rs index ba415f0..7eddc91 100644 --- a/src/test.rs +++ b/src/test.rs @@ -35,9 +35,12 @@ fn demo() { chk_vec!(l.all_mut_safe()); chk_vec!(l.all_mut_fast()); + l.prepend(s("one")); l.check_consistency(); + assert_eq!(l.head_and_tail_mut(), H::Both(&mut s("one"), &mut s("ho"))); + write!(l.front_mut().unwrap(), "!").unwrap(); - assert_eq!(l.pop_front(), Some(s("hi!"))); l.check_consistency(); - assert_eq!(l.front(), Some(&s("ho"))); l.check_consistency(); + assert_eq!(l.pop_front(), Some(s("one!"))); l.check_consistency(); + assert_eq!(l.front(), Some(&s("hi"))); l.check_consistency(); drop(l); }