Lines
100 %
Functions
Branches
use super::*;
fn drawn() -> RowWindow {
let window = RowWindow::default();
let _ = window.fit(30, 8);
window
}
#[test]
fn lines_and_pages_move_within_the_content() {
let window = drawn();
assert!(apply(&window, Intent::ScrollLineDown));
assert_eq!(window.top(), 1);
assert!(apply(&window, Intent::ScrollPageDown));
assert_eq!(window.top(), 9);
assert!(apply(&window, Intent::ScrollPageUp));
assert!(apply(&window, Intent::ScrollLineUp));
assert_eq!(window.top(), 0);
fn scrolling_stops_at_the_first_row_and_the_last_page() {
for _ in 0..5 {
assert_eq!(window.top(), 22);
fn top_and_end_jump_to_the_first_and_last_page() {
assert!(apply(&window, Intent::ScrollEnd));
assert!(apply(&window, Intent::ScrollTop));
fn other_intents_are_not_consumed() {
assert!(!apply(&window, Intent::ListSelectNext));