aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorMichael Davis2022-04-08 15:56:50 +0000
committerGitHub2022-04-08 15:56:50 +0000
commit19ff21eaa27141807ee206230d1e6e9f071b8180 (patch)
treed5ba077e8bbf2892a4a24312ba2ea302942106e5 /helix-core/src
parent61d1684a329e933261fbb3863f7cffbda89292ac (diff)
Remove usage of format ident feature from tests (#2028)
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/movement.rs12
-rw-r--r--helix-core/src/syntax.rs4
-rw-r--r--helix-core/src/test.rs8
-rw-r--r--helix-core/src/textobject.rs6
4 files changed, 16 insertions, 14 deletions
diff --git a/helix-core/src/movement.rs b/helix-core/src/movement.rs
index e695bf94..f60b3c83 100644
--- a/helix-core/src/movement.rs
+++ b/helix-core/src/movement.rs
@@ -1293,7 +1293,7 @@ mod test {
let selection =
selection.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Move));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -1316,7 +1316,7 @@ mod test {
let selection =
selection.transform(|r| move_prev_paragraph(text.slice(..), r, 2, Movement::Move));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -1339,7 +1339,7 @@ mod test {
let selection = selection
.transform(|r| move_prev_paragraph(text.slice(..), r, 1, Movement::Extend));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -1381,7 +1381,7 @@ mod test {
let selection =
selection.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Move));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -1404,7 +1404,7 @@ mod test {
let selection =
selection.transform(|r| move_next_paragraph(text.slice(..), r, 2, Movement::Move));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -1427,7 +1427,7 @@ mod test {
let selection = selection
.transform(|r| move_next_paragraph(text.slice(..), r, 1, Movement::Extend));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
}
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index bb0073e1..72b0e956 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -1996,7 +1996,9 @@ mod test {
assert_eq!(
matches[0].byte_range(),
range,
- "@{capture} expected {range:?}"
+ "@{} expected {:?}",
+ capture,
+ range
)
};
diff --git a/helix-core/src/test.rs b/helix-core/src/test.rs
index 064ca8a3..45503107 100644
--- a/helix-core/src/test.rs
+++ b/helix-core/src/test.rs
@@ -53,7 +53,7 @@ pub fn print(s: &str) -> (String, Selection) {
};
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();
@@ -85,15 +85,15 @@ pub fn print(s: &str) -> (String, Selection) {
}
if head_at_beg {
- panic!("missing end `{close_pair}#` {left:?} {s:?}");
+ panic!("missing end `{}#` {:?} {:?}", close_pair, left, s);
} else {
- panic!("missing end `|{close_pair}#` {left:?} {s:?}");
+ panic!("missing end `|{}#` {:?} {:?}", close_pair, left, s);
}
}
let primary = match primary_idx {
Some(i) => i,
- None => panic!("missing primary `#[|]#` {s:?}"),
+ None => panic!("missing primary `#[|]#` {:?}", s),
};
let selection = Selection::new(ranges, primary);
(left, selection)
diff --git a/helix-core/src/textobject.rs b/helix-core/src/textobject.rs
index 67bf40a6..e7bbfc43 100644
--- a/helix-core/src/textobject.rs
+++ b/helix-core/src/textobject.rs
@@ -381,7 +381,7 @@ mod test {
let selection = selection
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 1));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -404,7 +404,7 @@ mod test {
let selection = selection
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Inside, 2));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}
@@ -435,7 +435,7 @@ mod test {
let selection = selection
.transform(|r| textobject_paragraph(text.slice(..), r, TextObject::Around, 1));
let actual = crate::test::plain(&s, selection);
- assert_eq!(actual, expected, "\nbefore: `{before:?}`");
+ assert_eq!(actual, expected, "\nbefore: `{:?}`", before);
}
}