},
width: 0,
first_visible: 0,
+ prompt: ColouredString::plain(""),
+ promptwidth: 0,
};
sle.cut_to_end();
},
width: 5,
first_visible: 0,
+ prompt: ColouredString::plain(""),
+ promptwidth: 0,
};
assert_eq!(sle.draw(sle.width),
#[cfg(test)]
fn test_new(conf: InstanceStatusConfig, text: &str) -> Self {
- Self::new(conf, FileHeader::new(ColouredString::plain("dummy")), text)
+ Self::new(conf, FileHeader::new(ColouredString::plain("dummy")),
+ None, Post::with_text(text))
}
fn is_line_boundary(c: char) -> bool {
));
assert_eq!(NotificationLog::new(
- t, "foo@example.com", "Foo Bar", "123", None,
- NotificationType::Reblog, Some(&post)).render(80), vec! {
+ t, "foo@example.com", "Foo Bar", "123",
+ NotificationType::Reblog, Some(&post), None).render(80), vec! {
ColouredString::general("Fri Aug 3 04:05:06 2001 Foo Bar (foo@example.com) boosted: take a look at this",
" "),
ColouredString::general(" otter! @badger might also like it",
});
assert_eq!(NotificationLog::new(
- t, "foo@example.com", "Foo Bar", "123", None,
- NotificationType::Favourite, Some(&post)).render(51), vec! {
+ t, "foo@example.com", "Foo Bar", "123",
+ NotificationType::Favourite, Some(&post), None).render(51), vec! {
ColouredString::general("Fri Aug 3 04:05:06 2001 Foo Bar (foo@example.com)",
" "),
ColouredString::general(" favourited: take a look at this otter! @badger...",
});
assert_eq!(NotificationLog::new(
- t, "foo@example.com", "Foo Bar", "123", None,
- NotificationType::Follow, None).render(80), vec! {
+ t, "foo@example.com", "Foo Bar", "123",
+ NotificationType::Follow, None, None).render(80), vec! {
ColouredString::general("Fri Aug 3 04:05:06 2001 Foo Bar (foo@example.com) followed you",
" "),
});
#[test]
fn test_user_list_entry() {
- assert_eq!(UserListEntry::new("foo@example.com", "Foo Bar")
+ assert_eq!(UserListEntry::new("foo@example.com", "Foo Bar", "123")
.render(80), vec! {
ColouredString::general("Foo Bar (foo@example.com)",
" "),