test: add test for unicode range test#1630
Conversation
WalkthroughThe pull request introduces new test cases in the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
crates/pyo3/tests/test_range.py (1)
51-52: Uncomment and fix the column assertionThe TODO comment is correct - the column should indeed be 5 in character count:
- "ハロ" (2 characters) + " = " (3 characters) = 5 characters total
Would you like me to:
- Investigate why the column assertion is failing?
- Open an issue to track this character-vs-byte position discrepancy?
Here's the suggested fix:
- # TODO: Fix this, it should be 5 in character - # assert node.range().start.column == 5 + assert node.range().start.column == 5 # 2 chars (ハロ) + 3 chars ( = )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
crates/core/src/node.rs(1 hunks)crates/pyo3/tests/test_range.py(1 hunks)
🔇 Additional comments (2)
crates/pyo3/tests/test_range.py (1)
49-50: LGTM! The index and line assertions are correct.
The assertions correctly verify that:
start.index == 5matches the byte position after "ハロ = "start.line == 0correctly identifies the first line
crates/core/src/node.rs (1)
701-708: LGTM! Well-structured test for ASCII character positions.
The test correctly validates the start and end positions for a single ASCII character, which serves as a good baseline test case.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1630 +/- ##
==========================================
- Coverage 87.03% 86.99% -0.04%
==========================================
Files 95 95
Lines 15277 15291 +14
==========================================
+ Hits 13296 13303 +7
- Misses 1981 1988 +7 ☔ View full report in Codecov by Sentry. |
part of #1594
Summary by CodeRabbit
test_unicodefunction to assert the line number of the node's range.