mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
Implement F631 (AssertTuple) (#99)
This commit is contained in:
parent
e2f46537fd
commit
312bfd8d2b
8 changed files with 61 additions and 0 deletions
|
@ -191,6 +191,37 @@ mod tests {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn f631() -> Result<()> {
|
||||
let actual = check_path(
|
||||
Path::new("./resources/test/fixtures/F631.py"),
|
||||
&settings::Settings {
|
||||
line_length: 88,
|
||||
exclude: vec![],
|
||||
select: BTreeSet::from([CheckCode::F631]),
|
||||
},
|
||||
&cache::Mode::None,
|
||||
)?;
|
||||
let expected = vec![
|
||||
Message {
|
||||
kind: CheckKind::AssertTuple,
|
||||
location: Location::new(1, 1),
|
||||
filename: "./resources/test/fixtures/F631.py".to_string(),
|
||||
},
|
||||
Message {
|
||||
kind: CheckKind::AssertTuple,
|
||||
location: Location::new(2, 1),
|
||||
filename: "./resources/test/fixtures/F631.py".to_string(),
|
||||
},
|
||||
];
|
||||
assert_eq!(actual.len(), expected.len());
|
||||
for i in 0..actual.len() {
|
||||
assert_eq!(actual[i], expected[i]);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn f634() -> Result<()> {
|
||||
let actual = check_path(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue