diff options
Diffstat (limited to 'vendor/term/tests')
31 files changed, 29 insertions, 0 deletions
diff --git a/vendor/term/tests/data/dumb b/vendor/term/tests/data/dumb Binary files differnew file mode 100644 index 000000000..fd4091a99 --- /dev/null +++ b/vendor/term/tests/data/dumb diff --git a/vendor/term/tests/data/linux b/vendor/term/tests/data/linux Binary files differnew file mode 100644 index 000000000..b458ffaf9 --- /dev/null +++ b/vendor/term/tests/data/linux diff --git a/vendor/term/tests/data/linux-16color b/vendor/term/tests/data/linux-16color Binary files differnew file mode 100644 index 000000000..8c2e4768b --- /dev/null +++ b/vendor/term/tests/data/linux-16color diff --git a/vendor/term/tests/data/linux-basic b/vendor/term/tests/data/linux-basic Binary files differnew file mode 100644 index 000000000..4f23cb9ad --- /dev/null +++ b/vendor/term/tests/data/linux-basic diff --git a/vendor/term/tests/data/linux-c b/vendor/term/tests/data/linux-c Binary files differnew file mode 100644 index 000000000..aa66f83d8 --- /dev/null +++ b/vendor/term/tests/data/linux-c diff --git a/vendor/term/tests/data/linux-c-nc b/vendor/term/tests/data/linux-c-nc Binary files differnew file mode 100644 index 000000000..da344e0de --- /dev/null +++ b/vendor/term/tests/data/linux-c-nc diff --git a/vendor/term/tests/data/linux-koi8 b/vendor/term/tests/data/linux-koi8 Binary files differnew file mode 100644 index 000000000..1333f2d9f --- /dev/null +++ b/vendor/term/tests/data/linux-koi8 diff --git a/vendor/term/tests/data/linux-koi8r b/vendor/term/tests/data/linux-koi8r Binary files differnew file mode 100644 index 000000000..e3cb2a18d --- /dev/null +++ b/vendor/term/tests/data/linux-koi8r diff --git a/vendor/term/tests/data/linux-lat b/vendor/term/tests/data/linux-lat Binary files differnew file mode 100644 index 000000000..9a428f96e --- /dev/null +++ b/vendor/term/tests/data/linux-lat diff --git a/vendor/term/tests/data/linux-m b/vendor/term/tests/data/linux-m Binary files differnew file mode 100644 index 000000000..65d418012 --- /dev/null +++ b/vendor/term/tests/data/linux-m diff --git a/vendor/term/tests/data/linux-nic b/vendor/term/tests/data/linux-nic Binary files differnew file mode 100644 index 000000000..84458a5f4 --- /dev/null +++ b/vendor/term/tests/data/linux-nic diff --git a/vendor/term/tests/data/linux-vt b/vendor/term/tests/data/linux-vt Binary files differnew file mode 100644 index 000000000..42df50d3b --- /dev/null +++ b/vendor/term/tests/data/linux-vt diff --git a/vendor/term/tests/data/linux2.2 b/vendor/term/tests/data/linux2.2 Binary files differnew file mode 100644 index 000000000..8656939f5 --- /dev/null +++ b/vendor/term/tests/data/linux2.2 diff --git a/vendor/term/tests/data/linux2.6 b/vendor/term/tests/data/linux2.6 Binary files differnew file mode 100644 index 000000000..4560270ae --- /dev/null +++ b/vendor/term/tests/data/linux2.6 diff --git a/vendor/term/tests/data/linux2.6.26 b/vendor/term/tests/data/linux2.6.26 Binary files differnew file mode 100644 index 000000000..7b9db4671 --- /dev/null +++ b/vendor/term/tests/data/linux2.6.26 diff --git a/vendor/term/tests/data/linux3.0 b/vendor/term/tests/data/linux3.0 Binary files differnew file mode 100644 index 000000000..c61f69626 --- /dev/null +++ b/vendor/term/tests/data/linux3.0 diff --git a/vendor/term/tests/data/rxvt b/vendor/term/tests/data/rxvt Binary files differnew file mode 100644 index 000000000..4d54c3249 --- /dev/null +++ b/vendor/term/tests/data/rxvt diff --git a/vendor/term/tests/data/rxvt-16color b/vendor/term/tests/data/rxvt-16color Binary files differnew file mode 100644 index 000000000..349701aae --- /dev/null +++ b/vendor/term/tests/data/rxvt-16color diff --git a/vendor/term/tests/data/rxvt-256color b/vendor/term/tests/data/rxvt-256color Binary files differnew file mode 100644 index 000000000..355cb6e11 --- /dev/null +++ b/vendor/term/tests/data/rxvt-256color diff --git a/vendor/term/tests/data/rxvt-88color b/vendor/term/tests/data/rxvt-88color Binary files differnew file mode 100644 index 000000000..91ae94737 --- /dev/null +++ b/vendor/term/tests/data/rxvt-88color diff --git a/vendor/term/tests/data/rxvt-basic b/vendor/term/tests/data/rxvt-basic Binary files differnew file mode 100644 index 000000000..05474636f --- /dev/null +++ b/vendor/term/tests/data/rxvt-basic diff --git a/vendor/term/tests/data/rxvt-color b/vendor/term/tests/data/rxvt-color Binary files differnew file mode 100644 index 000000000..8cf3cd9d9 --- /dev/null +++ b/vendor/term/tests/data/rxvt-color diff --git a/vendor/term/tests/data/rxvt-cygwin b/vendor/term/tests/data/rxvt-cygwin Binary files differnew file mode 100644 index 000000000..b122aa533 --- /dev/null +++ b/vendor/term/tests/data/rxvt-cygwin diff --git a/vendor/term/tests/data/rxvt-cygwin-native b/vendor/term/tests/data/rxvt-cygwin-native Binary files differnew file mode 100644 index 000000000..2350014d8 --- /dev/null +++ b/vendor/term/tests/data/rxvt-cygwin-native diff --git a/vendor/term/tests/data/rxvt-xpm b/vendor/term/tests/data/rxvt-xpm Binary files differnew file mode 100644 index 000000000..e0c77fdc0 --- /dev/null +++ b/vendor/term/tests/data/rxvt-xpm diff --git a/vendor/term/tests/data/screen b/vendor/term/tests/data/screen Binary files differnew file mode 100644 index 000000000..895f0f679 --- /dev/null +++ b/vendor/term/tests/data/screen diff --git a/vendor/term/tests/data/screen-256color b/vendor/term/tests/data/screen-256color Binary files differnew file mode 100644 index 000000000..11fbb23a8 --- /dev/null +++ b/vendor/term/tests/data/screen-256color diff --git a/vendor/term/tests/data/vt100 b/vendor/term/tests/data/vt100 Binary files differnew file mode 100644 index 000000000..d9d7ead9d --- /dev/null +++ b/vendor/term/tests/data/vt100 diff --git a/vendor/term/tests/data/xterm b/vendor/term/tests/data/xterm Binary files differnew file mode 100644 index 000000000..12ad5b33a --- /dev/null +++ b/vendor/term/tests/data/xterm diff --git a/vendor/term/tests/data/xterm-256color b/vendor/term/tests/data/xterm-256color Binary files differnew file mode 100644 index 000000000..470fbd467 --- /dev/null +++ b/vendor/term/tests/data/xterm-256color diff --git a/vendor/term/tests/terminfo.rs b/vendor/term/tests/terminfo.rs new file mode 100644 index 000000000..7e606ff01 --- /dev/null +++ b/vendor/term/tests/terminfo.rs @@ -0,0 +1,29 @@ +use std::fs; +use std::io; +use term::terminfo::TermInfo; +use term::terminfo::TerminfoTerminal; +use term::Terminal; + +#[test] +fn test_parse() { + for f in fs::read_dir("tests/data/").unwrap() { + let _ = TermInfo::from_path(f.unwrap().path()).unwrap(); + } +} + +#[test] +fn test_supports_color() { + fn supports_color(term: &str) -> bool { + let terminfo = TermInfo::from_path(format!("tests/data/{}", term)).unwrap(); + let term = TerminfoTerminal::new_with_terminfo(io::stdout(), terminfo); + term.supports_color() + } + assert!(supports_color("linux")); + assert!(!supports_color("dumb")); +} + +#[test] +fn test_fallback() { + TermInfo::from_name("ansi-cargo-test").expect("failed to use fallback"); + assert!(TermInfo::from_name("really-bad-terminal").is_err()); +} |