Struct k9::MultilineString [−][src]
assert_equal! takes a std::fmt::Debug trait object as an argument
which doesn’t work well with multiline strings, since newline characters will be displayed as \n
For example this string:
let s = "A B C";
will be printed as a single line "A\nB\nC"
, which is not useful
for multiline comparison diff
Using this struct makes the original string serialize into a proper multiline string which will produce a nice line by line difference comparison when used together with assert_equal!.
ⓘ
use k9::{MultilineString, assert_equal}; let s1 = "A\nB\nC".to_string(); let s2 = "A\nD\nC"; assert_equal!(MultilineString(s1), MultilineString::new(s2));
Implementations
impl MultilineString
[src]
Trait Implementations
impl Debug for MultilineString
[src]
Make diff to display string as multi-line string
impl Eq for MultilineString
[src]
impl PartialEq<MultilineString> for MultilineString
[src]
fn eq(&self, other: &MultilineString) -> bool
[src]
fn ne(&self, other: &MultilineString) -> bool
[src]
impl StructuralEq for MultilineString
[src]
impl StructuralPartialEq for MultilineString
[src]
Auto Trait Implementations
impl RefUnwindSafe for MultilineString
impl Send for MultilineString
impl Sync for MultilineString
impl Unpin for MultilineString
impl UnwindSafe for MultilineString
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> FormattableForComparison for T where
T: Debug,
[src]
T: Debug,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,