Fix off-by-one error in assert_eq! line wrapping
If two really long conditions are checked for equality, they wouldn't be split into multiple lines if the last condition is the one to push the line past the width limit. Fix the off-by-one error that caused this, and add a test-case for it.
This commit is contained in:
parent
e343521276
commit
ef8b2efd13
3 changed files with 10 additions and 3 deletions
|
|
@ -2081,7 +2081,7 @@ where
|
|||
{
|
||||
let one_line_before = all_simple_before
|
||||
&& definitive_tactic(
|
||||
&item_vec[..num_args_before - 1],
|
||||
&item_vec[..num_args_before],
|
||||
ListTactic::HorizontalVertical,
|
||||
Separator::Comma,
|
||||
nested_shape.width,
|
||||
|
|
@ -2140,8 +2140,8 @@ fn maybe_get_args_offset<T: ToExpr>(callee_str: &str, args: &[&T]) -> Option<(bo
|
|||
.iter()
|
||||
.find(|&&(s, _)| s == callee_str)
|
||||
{
|
||||
let all_simple_before = num_args_before >= 1 && args.len() >= num_args_before
|
||||
&& is_every_args_simple(&args[..num_args_before]);
|
||||
let all_simple_before =
|
||||
args.len() >= num_args_before && is_every_args_simple(&args[..num_args_before]);
|
||||
|
||||
let all_simple_after =
|
||||
args.len() >= num_args_before + 1 && is_every_args_simple(&args[num_args_before + 1..]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue