mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Remove usage of format ident feature from tests (#2028)
This commit is contained in:
parent
61d1684a32
commit
19ff21eaa2
@ -1293,7 +1293,7 @@ fn test_behaviour_when_moving_to_prev_paragraph_single() {
|
|||||||
let selection =
|
let selection =
|
||||||
selection.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Move));
|
selection.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Move));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1316,7 +1316,7 @@ fn test_behaviour_when_moving_to_prev_paragraph_double() {
|
|||||||
let selection =
|
let selection =
|
||||||
selection.transform(|r| move_prev_paragraph(text.slice(..), r, 2, Movement::Move));
|
selection.transform(|r| move_prev_paragraph(text.slice(..), r, 2, Movement::Move));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1339,7 +1339,7 @@ fn test_behaviour_when_moving_to_prev_paragraph_extend() {
|
|||||||
let selection = selection
|
let selection = selection
|
||||||
.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Extend));
|
.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Extend));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1381,7 +1381,7 @@ fn test_behaviour_when_moving_to_next_paragraph_single() {
|
|||||||
let selection =
|
let selection =
|
||||||
selection.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Move));
|
selection.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Move));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1404,7 +1404,7 @@ fn test_behaviour_when_moving_to_next_paragraph_double() {
|
|||||||
let selection =
|
let selection =
|
||||||
selection.transform(|r| move_next_paragraph(text.slice(..), r, 2, Movement::Move));
|
selection.transform(|r| move_next_paragraph(text.slice(..), r, 2, Movement::Move));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1427,7 +1427,7 @@ fn test_behaviour_when_moving_to_next_paragraph_extend() {
|
|||||||
let selection = selection
|
let selection = selection
|
||||||
.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Extend));
|
.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Extend));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1996,7 +1996,9 @@ fn test_textobject_queries() {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
matches[0].byte_range(),
|
matches[0].byte_range(),
|
||||||
range,
|
range,
|
||||||
"@{capture} expected {range:?}"
|
"@{} expected {:?}",
|
||||||
|
capture,
|
||||||
|
range
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ pub fn print(s: &str) -> (String, Selection) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if is_primary && primary_idx.is_some() {
|
if is_primary && primary_idx.is_some() {
|
||||||
panic!("primary `#[` already appeared {left:?} {s:?}");
|
panic!("primary `#[` already appeared {:?} {:?}", left, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
let head_at_beg = iter.next_if_eq(&'|').is_some();
|
let head_at_beg = iter.next_if_eq(&'|').is_some();
|
||||||
@ -85,15 +85,15 @@ pub fn print(s: &str) -> (String, Selection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if head_at_beg {
|
if head_at_beg {
|
||||||
panic!("missing end `{close_pair}#` {left:?} {s:?}");
|
panic!("missing end `{}#` {:?} {:?}", close_pair, left, s);
|
||||||
} else {
|
} else {
|
||||||
panic!("missing end `|{close_pair}#` {left:?} {s:?}");
|
panic!("missing end `|{}#` {:?} {:?}", close_pair, left, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let primary = match primary_idx {
|
let primary = match primary_idx {
|
||||||
Some(i) => i,
|
Some(i) => i,
|
||||||
None => panic!("missing primary `#[|]#` {s:?}"),
|
None => panic!("missing primary `#[|]#` {:?}", s),
|
||||||
};
|
};
|
||||||
let selection = Selection::new(ranges, primary);
|
let selection = Selection::new(ranges, primary);
|
||||||
(left, selection)
|
(left, selection)
|
||||||
|
@ -381,7 +381,7 @@ fn test_textobject_paragraph_inside_single() {
|
|||||||
let selection = selection
|
let selection = selection
|
||||||
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 1));
|
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 1));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ fn test_textobject_paragraph_inside_double() {
|
|||||||
let selection = selection
|
let selection = selection
|
||||||
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 2));
|
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 2));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ fn test_textobject_paragraph_around_single() {
|
|||||||
let selection = selection
|
let selection = selection
|
||||||
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Around, 1));
|
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Around, 1));
|
||||||
let actual = crate::test::plain(&s, selection);
|
let actual = crate::test::plain(&s, selection);
|
||||||
assert_eq!(actual, expected, "\nbefore: `{before:?}`");
|
assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user