diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-05-05 22:50:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 22:50:23 +0000 |
commit | 81ce93574f62d4b117fdd79af65391f30316a457 (patch) | |
tree | 951a0578860c6028e2dfff0ca83879001c6b2385 /alacritty_terminal/src/grid/tests.rs | |
parent | 04f0bcaf54ed373128ca0f84ee8fcdd8e52bce23 (diff) | |
download | alacritty-81ce93574f62d4b117fdd79af65391f30316a457.tar.gz alacritty-81ce93574f62d4b117fdd79af65391f30316a457.zip |
Extend style guideline documentation
Diffstat (limited to 'alacritty_terminal/src/grid/tests.rs')
-rw-r--r-- | alacritty_terminal/src/grid/tests.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/alacritty_terminal/src/grid/tests.rs b/alacritty_terminal/src/grid/tests.rs index e8f4fb8d..ef011d16 100644 --- a/alacritty_terminal/src/grid/tests.rs +++ b/alacritty_terminal/src/grid/tests.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Tests for the Grid +//! Tests for the Grid. use super::{BidirectionalIterator, Grid}; use crate::grid::GridCell; @@ -71,7 +71,7 @@ fn visible_to_buffer() { assert_eq!(point, Point::new(4, Column(3))); } -// Scroll up moves lines upwards +// Scroll up moves lines upwards. #[test] fn scroll_up() { let mut grid = Grid::new(Line(10), Column(1), 0, 0); @@ -97,13 +97,13 @@ fn scroll_up() { assert_eq!(grid[Line(6)].occ, 1); assert_eq!(grid[Line(7)][Column(0)], 9); assert_eq!(grid[Line(7)].occ, 1); - assert_eq!(grid[Line(8)][Column(0)], 0); // was 0 + assert_eq!(grid[Line(8)][Column(0)], 0); // was 0. assert_eq!(grid[Line(8)].occ, 0); - assert_eq!(grid[Line(9)][Column(0)], 0); // was 1 + assert_eq!(grid[Line(9)][Column(0)], 0); // was 1. assert_eq!(grid[Line(9)].occ, 0); } -// Scroll down moves lines downwards +// Scroll down moves lines downwards. #[test] fn scroll_down() { let mut grid = Grid::new(Line(10), Column(1), 0, 0); @@ -113,9 +113,9 @@ fn scroll_down() { grid.scroll_down(&(Line(0)..Line(10)), Line(2), &0); - assert_eq!(grid[Line(0)][Column(0)], 0); // was 8 + assert_eq!(grid[Line(0)][Column(0)], 0); // was 8. assert_eq!(grid[Line(0)].occ, 0); - assert_eq!(grid[Line(1)][Column(0)], 0); // was 9 + assert_eq!(grid[Line(1)][Column(0)], 0); // was 9. assert_eq!(grid[Line(1)].occ, 0); assert_eq!(grid[Line(2)][Column(0)], 0); assert_eq!(grid[Line(2)].occ, 1); @@ -135,7 +135,7 @@ fn scroll_down() { assert_eq!(grid[Line(9)].occ, 1); } -// Test that GridIterator works +// Test that GridIterator works. #[test] fn test_iter() { let mut grid = Grid::new(Line(5), Column(5), 0, 0); @@ -156,7 +156,7 @@ fn test_iter() { assert_eq!(Some(&3), iter.next()); assert_eq!(Some(&4), iter.next()); - // test linewrapping + // Test line-wrapping. assert_eq!(Some(&5), iter.next()); assert_eq!(Column(0), iter.point().col); assert_eq!(3, iter.point().line); @@ -165,10 +165,10 @@ fn test_iter() { assert_eq!(Column(4), iter.point().col); assert_eq!(4, iter.point().line); - // Make sure iter.cell() returns the current iterator position + // Make sure iter.cell() returns the current iterator position. assert_eq!(&4, iter.cell()); - // test that iter ends at end of grid + // Test that iter ends at end of grid. let mut final_iter = grid.iter_from(Point { line: 0, col: Column(4) }); assert_eq!(None, final_iter.next()); assert_eq!(Some(&23), final_iter.prev()); @@ -282,7 +282,7 @@ fn grow_reflow() { assert_eq!(grid[1][Column(1)], cell('2')); assert_eq!(grid[1][Column(2)], cell('3')); - // Make sure rest of grid is empty + // Make sure rest of grid is empty. assert_eq!(grid[0].len(), 3); assert_eq!(grid[0][Column(0)], Cell::default()); assert_eq!(grid[0][Column(1)], Cell::default()); @@ -311,7 +311,7 @@ fn grow_reflow_multiline() { assert_eq!(grid[2][Column(4)], cell('5')); assert_eq!(grid[2][Column(5)], cell('6')); - // Make sure rest of grid is empty + // Make sure rest of grid is empty. // https://github.com/rust-lang/rust-clippy/issues/3788 #[allow(clippy::needless_range_loop)] for r in 0..2 { |