You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: resize.rs
    path of file: ./repos/tiny/crates/libtiny_tui/src/tests
    
    the code of the file until where you have to start completion: use std::fs::File;
use std::io::{BufRead, BufReader};
use std::panic::Location;

use libtiny_common::{ChanNameRef, MsgTarget};
use term_input::{Arrow, Key};

use crate::test_utils::expect_screen;
use crate::tui::TUI;

#[test]
fn test_resize_recalc_scroll() {
    let mut tui = TUI::new_test(15, 5);
    let serv = "irc.server_1.org";
    let chan = ChanNameRef::new("#chan");
    tui.new_server_tab(serv, None);
    tui.set_nick(serv, "osa1");
    tui.new_chan_tab(serv, chan);
    tui.next_tab();
    tui.next_tab();

    let target = MsgTarget::Chan { serv, chan };
    let ts = time::at_utc(time::Timespec::new(0, 0));
    tui.add_privmsg(
        "osa1",
        "s 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 e",
        ts,
        &target,
        false,
        false,
    );

    tui.draw();

    // at bottom with no scroll
    #[rustfmt::skip]
    l
    
fn test_resize_recalc_scroll() {
    let mut tui = TUI::new_test(15, 5);
    let serv = "irc.server_1.org";
    let chan = ChanNameRef::new("#chan");
    tui.new_server_tab(serv, None);
    tui.set_nick(serv, "osa1");
    tui.new_chan_tab(serv, chan);
    tui.next_tab();
    tui.next_tab();

    let target = MsgTarget::Chan { serv, chan };
    let ts = time::at_utc(time::Timespec::new(0, 0));
    tui.add_privmsg(
        "osa1",
        "s 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 e",
        ts,
        &target,
        false,
        false,
    );

    tui.draw();

    // at bottom with no scroll
    #[rustfmt::skip]
    let screen1 =
       "|1111 1111 1111 |
        |1111 1111 1111 |
        |1111 e         |
        |               |
        |< #chan        |";

    expect_screen(screen1, &tui.get_front_buffer(), 15, 5, Location::caller());

    // hit the home key to go to the top of the messages and then resize the screen
    let home = term_input::Event::Key(Key::Home);
    tui.handle_input_event(home, &mut None);
    tui.set_size(16, 7);
    tui.draw();

    // should be at the top of message after resize
    #[rustfmt::skip]
    let screen2 =
       "|00:00 osa1: s   |
        |1111 1111 1111  |
        |1111 1111 1111  |
        |1111 1111 1111  |
        |1111 1111 1111  |
        |                |
        |< #chan         |";

    expect_screen(screen2, &tui.get_front_buffer(), 16, 7, Location::caller());

    // go back to the bottom
    let end = term_input::Event::Key(Key::End);
    tui.handle_input_event(end, &mut None);
    tui.draw();

    // go back to the bottom
    #[rustfmt::skip]
    let screen3 = 
       "|1111 1111 1111  |
        |1111 1111 1111  |
        |1111 1111 1111  |
        |1111 1111 1111  |
        |1111 e          |
        |                |
        |< #chan         |";

    expect_screen(screen3, &tui.get_front_buffer(), 16, 7, Location::caller());
}