mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Add test for Notebook text output (#7925)
## Summary This PR adds test cases for the Notebook output in text format. ## Test Plan Update test snapshots.
This commit is contained in:
parent
cd564c4200
commit
f08a5f67eb
5 changed files with 177 additions and 2 deletions
|
@ -15,6 +15,13 @@ pub struct NotebookIndex {
|
|||
}
|
||||
|
||||
impl NotebookIndex {
|
||||
pub fn new(row_to_cell: Vec<OneIndexed>, row_to_row_in_cell: Vec<OneIndexed>) -> Self {
|
||||
Self {
|
||||
row_to_cell,
|
||||
row_to_row_in_cell,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the cell number (1-based) for the given row (1-based).
|
||||
pub fn cell(&self, row: OneIndexed) -> Option<OneIndexed> {
|
||||
self.row_to_cell.get(row.to_zero_indexed()).copied()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue