mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Start stdx
This crate will hold everything to small to be worth publishing
This commit is contained in:
parent
a1fea0d34e
commit
b764c38436
13 changed files with 163 additions and 104 deletions
|
@ -200,8 +200,8 @@ fn check_struct_shorthand_initialization(
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use insta::assert_debug_snapshot;
|
||||
use join_to_string::join;
|
||||
use ra_syntax::SourceFile;
|
||||
use stdx::SepBy;
|
||||
use test_utils::assert_eq_text;
|
||||
|
||||
use crate::mock_analysis::{analysis_and_position, single_file};
|
||||
|
@ -254,16 +254,12 @@ mod tests {
|
|||
.map(|it| it.len() - it.trim_start().len())
|
||||
.next()
|
||||
.expect("empty fixture");
|
||||
let after = join(after.lines().filter_map(|line| {
|
||||
if line.len() > margin {
|
||||
Some(&line[margin..])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}))
|
||||
.separator("\n")
|
||||
.suffix("\n")
|
||||
.to_string();
|
||||
let after = after
|
||||
.lines()
|
||||
.filter_map(|line| if line.len() > margin { Some(&line[margin..]) } else { None })
|
||||
.sep_by("\n")
|
||||
.suffix("\n")
|
||||
.to_string();
|
||||
|
||||
assert_eq_text!(&after, &actual);
|
||||
assert!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue