From 4f18fa6733d3c480ac2c6fd09f595f6b0b51c7c2 Mon Sep 17 00:00:00 2001 From: Artem Mukhin Date: Fri, 17 Feb 2023 01:45:29 +0100 Subject: [PATCH] Add test case for '\u' prefix in B005 (#2976) Based on #2958. --- .../resources/test/fixtures/flake8_bugbear/B005.py | 2 ++ ...ff__rules__flake8_bugbear__tests__B005_B005.py.snap | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/crates/ruff/resources/test/fixtures/flake8_bugbear/B005.py b/crates/ruff/resources/test/fixtures/flake8_bugbear/B005.py index 2785831146..daafd83ab6 100644 --- a/crates/ruff/resources/test/fixtures/flake8_bugbear/B005.py +++ b/crates/ruff/resources/test/fixtures/flake8_bugbear/B005.py @@ -20,6 +20,8 @@ s.rstrip(r"\n\t ") # warning s.strip("a") # no warning s.strip("あ") # no warning s.strip("ああ") # warning +s.strip("\ufeff") # no warning +s.strip("\u0074\u0065\u0073\u0074") # warning from somewhere import other_type, strip diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap index 51a582a139..8948445b17 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap @@ -72,4 +72,14 @@ expression: diagnostics column: 13 fix: ~ parent: ~ +- kind: + StripWithMultiCharacters: ~ + location: + row: 24 + column: 0 + end_location: + row: 24 + column: 35 + fix: ~ + parent: ~