mirror of https://github.com/astral-sh/ruff
[ty] Switch completion tests to use "insertion" text in snapshots
I think this gives us better tests overall, since it tells us what is actually going to be inserted. Plus, we'll want this in the next commit.
This commit is contained in:
parent
4e1cf5747a
commit
1e00300c2a
|
|
@ -2558,9 +2558,7 @@ def frob(): ...
|
|||
|
||||
assert_snapshot!(
|
||||
builder.skip_keywords().skip_builtins().build().snapshot(),
|
||||
@r"
|
||||
foo
|
||||
",
|
||||
@"foo=",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -2574,9 +2572,7 @@ def frob(): ...
|
|||
|
||||
assert_snapshot!(
|
||||
builder.skip_keywords().skip_builtins().build().snapshot(),
|
||||
@r"
|
||||
foo
|
||||
",
|
||||
@"foo=",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -3233,7 +3229,7 @@ bar(o<CURSOR>
|
|||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
foo
|
||||
okay
|
||||
okay=
|
||||
"
|
||||
);
|
||||
}
|
||||
|
|
@ -3254,7 +3250,7 @@ bar(o<CURSOR>
|
|||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
foo
|
||||
okay
|
||||
okay=
|
||||
"
|
||||
);
|
||||
}
|
||||
|
|
@ -3272,9 +3268,9 @@ foo(b<CURSOR>
|
|||
assert_snapshot!(
|
||||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
bar
|
||||
barbaz
|
||||
baz
|
||||
bar=
|
||||
barbaz=
|
||||
baz=
|
||||
"
|
||||
);
|
||||
}
|
||||
|
|
@ -3291,9 +3287,7 @@ foo(bar=1, b<CURSOR>
|
|||
|
||||
assert_snapshot!(
|
||||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
baz
|
||||
"
|
||||
@"baz="
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -3311,9 +3305,7 @@ abc(o<CURSOR>
|
|||
|
||||
assert_snapshot!(
|
||||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
okay
|
||||
"
|
||||
@"okay="
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -3329,9 +3321,7 @@ abc(okay=1, ba<CURSOR> baz=5
|
|||
|
||||
assert_snapshot!(
|
||||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
bar
|
||||
"
|
||||
@"bar="
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -3375,9 +3365,9 @@ bar(o<CURSOR>
|
|||
builder.skip_keywords().skip_builtins().skip_auto_import().build().snapshot(),
|
||||
@r"
|
||||
foo
|
||||
okay
|
||||
okay_abc
|
||||
okay_okay
|
||||
okay=
|
||||
okay_abc=
|
||||
okay_okay=
|
||||
"
|
||||
);
|
||||
}
|
||||
|
|
@ -3397,7 +3387,7 @@ bar(<CURSOR>
|
|||
assert_snapshot!(builder.skip_keywords().skip_builtins().build().snapshot(), @r"
|
||||
bar
|
||||
foo
|
||||
okay
|
||||
okay=
|
||||
");
|
||||
}
|
||||
|
||||
|
|
@ -6793,7 +6783,7 @@ def f(zqzqzq: str):
|
|||
self.filtered
|
||||
.iter()
|
||||
.map(|c| {
|
||||
let mut snapshot = c.name.as_str().to_string();
|
||||
let mut snapshot = c.insert.as_deref().unwrap_or(c.name.as_str()).to_string();
|
||||
if self.type_signatures {
|
||||
let ty =
|
||||
c.ty.map(|ty| ty.display(self.db).to_string())
|
||||
|
|
|
|||
Loading…
Reference in New Issue