on master help sign in
Remove usage of format ident feature from tests (#2028)
commit19ff21eaa27141807ee206230d1e6e9f071b8180 authorMichael Davis <mcarsondavis@gmail.com> dateFri 8 Apr 2022, 10:56 (5 years ago) parent61d1684
4 files changed+16−14
helix-core/src/movement.rs+6−6 helix-core/src/syntax.rs+3−1 helix-core/src/test.rs+4−4 helix-core/src/textobject.rs+3−3
helix-core/src/movement.rs+6−6
@@ -1293,7 +1293,7 @@ mod test {
12931293 let selection =
12941294 selection.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Move));
12951295 let actual = crate::test::plain(&s, selection);
1296− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
1296+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
12971297 }
12981298 }
12991299
@@ -1316,7 +1316,7 @@ mod test {
13161316 let selection =
13171317 selection.transform(|r| move_prev_paragraph(text.slice(..), r, 2, Movement::Move));
13181318 let actual = crate::test::plain(&s, selection);
1319− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
1319+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
13201320 }
13211321 }
13221322
@@ -1339,7 +1339,7 @@ mod test {
13391339 let selection = selection
13401340 .transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Extend));
13411341 let actual = crate::test::plain(&s, selection);
1342− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
1342+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
13431343 }
13441344 }
13451345
@@ -1381,7 +1381,7 @@ mod test {
13811381 let selection =
13821382 selection.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Move));
13831383 let actual = crate::test::plain(&s, selection);
1384− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
1384+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
13851385 }
13861386 }
13871387
@@ -1404,7 +1404,7 @@ mod test {
14041404 let selection =
14051405 selection.transform(|r| move_next_paragraph(text.slice(..), r, 2, Movement::Move));
14061406 let actual = crate::test::plain(&s, selection);
1407− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
1407+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
14081408 }
14091409 }
14101410
@@ -1427,7 +1427,7 @@ mod test {
14271427 let selection = selection
14281428 .transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Extend));
14291429 let actual = crate::test::plain(&s, selection);
1430− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
1430+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
14311431 }
14321432 }
14331433}
helix-core/src/syntax.rs+3−1
@@ -1996,7 +1996,9 @@ mod test {
19961996 assert_eq!(
19971997 matches[0].byte_range(),
19981998 range,
1999− "@{capture} expected {range:?}"
1999+ "@{} expected {:?}",
2000+ capture,
2001+ range
20002002 )
20012003 };
20022004
helix-core/src/test.rs+4−4
@@ -53,7 +53,7 @@ pub fn print(s: &str) -> (String, Selection) {
5353 };
5454
5555 if is_primary && primary_idx.is_some() {
56− panic!("primary `#[` already appeared {left:?} {s:?}");
56+ panic!("primary `#[` already appeared {:?} {:?}", left, s);
5757 }
5858
5959 let head_at_beg = iter.next_if_eq(&'|').is_some();
@@ -85,15 +85,15 @@ pub fn print(s: &str) -> (String, Selection) {
8585 }
8686
8787 if head_at_beg {
88− panic!("missing end `{close_pair}#` {left:?} {s:?}");
88+ panic!("missing end `{}#` {:?} {:?}", close_pair, left, s);
8989 } else {
90− panic!("missing end `|{close_pair}#` {left:?} {s:?}");
90+ panic!("missing end `|{}#` {:?} {:?}", close_pair, left, s);
9191 }
9292 }
9393
9494 let primary = match primary_idx {
9595 Some(i) => i,
96− None => panic!("missing primary `#[|]#` {s:?}"),
96+ None => panic!("missing primary `#[|]#` {:?}", s),
9797 };
9898 let selection = Selection::new(ranges, primary);
9999 (left, selection)
helix-core/src/textobject.rs+3−3
@@ -381,7 +381,7 @@ mod test {
381381 let selection = selection
382382 .transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 1));
383383 let actual = crate::test::plain(&s, selection);
384− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
384+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
385385 }
386386 }
387387
@@ -404,7 +404,7 @@ mod test {
404404 let selection = selection
405405 .transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 2));
406406 let actual = crate::test::plain(&s, selection);
407− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
407+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
408408 }
409409 }
410410
@@ -435,7 +435,7 @@ mod test {
435435 let selection = selection
436436 .transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Around, 1));
437437 let actual = crate::test::plain(&s, selection);
438− assert_eq!(actual, expected, "\nbefore: `{before:?}`");
438+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
439439 }
440440 }
441441