Skip to content

Commit

Permalink
fix test_styled_label_delimiter from PR gyscos#786
Browse files Browse the repository at this point in the history
  • Loading branch information
correabuscar committed Jun 5, 2024
1 parent 4ef67e4 commit 3dd1343
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cursive-core/src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use crate::utils::markup::PlainStr;
use crate::utils::span::SpannedStr;
use crate::utils::span::SpannedText;
use crate::{event::Callback, theme::Style, utils::markup::StyledString, Cursive, With};
use std::sync::Arc;

Expand Down Expand Up @@ -91,7 +92,7 @@ impl Item {
/// Returns a vertical bar string if `self` is a delimiter.
pub fn label(&self) -> &str {
match *self {
Item::Delimiter => "│",
Item::Delimiter => DELIMITER.source(),
Item::Leaf { ref label, .. } | Item::Subtree { ref label, .. } => label.source(),
}
}
Expand Down Expand Up @@ -354,10 +355,10 @@ mod tests {
fn test_styled_label_delimiter() {
let item = Item::Delimiter;
let styled_label = item.styled_label();
assert_eq!(styled_label.source(), "|");
assert_eq!(styled_label.source(), DELIMITER.source());

let expected_spans: Vec<Span<Style>> = vec![Span {
content: "|",
content: DELIMITER.source(),
attr: &Style {
effects: EnumSet::EMPTY,
color: ColorStyle {
Expand Down

0 comments on commit 3dd1343

Please sign in to comment.