Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
datafusion-rustyline 2.0.0-alpha-20180628 - Docs.rs
[go: Go Back, main page]

datafusion-rustyline 2.0.0-alpha-20180628

Unofficial nightly releases of Rustyline
Documentation
//! Vi insert mode specific key bindings
use super::assert_cursor;
use config::EditMode;
use consts::KeyPress;

#[test]
fn insert_mode_by_default() {
    assert_cursor(
        EditMode::Vi,
        ("", ""),
        &[KeyPress::Char('a'), KeyPress::Enter],
        ("a", ""),
    );
}

#[test]
fn ctrl_h() {
    assert_cursor(
        EditMode::Vi,
        ("Hi", ""),
        &[KeyPress::Ctrl('H'), KeyPress::Enter],
        ("H", ""),
    );
}

#[test]
fn backspace() {
    assert_cursor(
        EditMode::Vi,
        ("", ""),
        &[KeyPress::Backspace, KeyPress::Enter],
        ("", ""),
    );
    assert_cursor(
        EditMode::Vi,
        ("Hi", ""),
        &[KeyPress::Backspace, KeyPress::Enter],
        ("H", ""),
    );
    assert_cursor(
        EditMode::Vi,
        ("", "Hi"),
        &[KeyPress::Backspace, KeyPress::Enter],
        ("", "Hi"),
    );
}

#[test]
fn esc() {
    assert_cursor(
        EditMode::Vi,
        ("", ""),
        &[KeyPress::Char('a'), KeyPress::Esc, KeyPress::Enter],
        ("", "a"),
    );
}