summaryrefslogtreecommitdiffstats
path: root/vendor/term/tests
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/term/tests')
-rw-r--r--vendor/term/tests/data/dumbbin0 -> 308 bytes
-rw-r--r--vendor/term/tests/data/linuxbin0 -> 1780 bytes
-rw-r--r--vendor/term/tests/data/linux-16colorbin0 -> 1858 bytes
-rw-r--r--vendor/term/tests/data/linux-basicbin0 -> 1664 bytes
-rw-r--r--vendor/term/tests/data/linux-cbin0 -> 2120 bytes
-rw-r--r--vendor/term/tests/data/linux-c-ncbin0 -> 1766 bytes
-rw-r--r--vendor/term/tests/data/linux-koi8bin0 -> 1808 bytes
-rw-r--r--vendor/term/tests/data/linux-koi8rbin0 -> 1814 bytes
-rw-r--r--vendor/term/tests/data/linux-latbin0 -> 1822 bytes
-rw-r--r--vendor/term/tests/data/linux-mbin0 -> 1770 bytes
-rw-r--r--vendor/term/tests/data/linux-nicbin0 -> 1810 bytes
-rw-r--r--vendor/term/tests/data/linux-vtbin0 -> 1702 bytes
-rw-r--r--vendor/term/tests/data/linux2.2bin0 -> 1788 bytes
-rw-r--r--vendor/term/tests/data/linux2.6bin0 -> 1785 bytes
-rw-r--r--vendor/term/tests/data/linux2.6.26bin0 -> 1789 bytes
-rw-r--r--vendor/term/tests/data/linux3.0bin0 -> 1788 bytes
-rw-r--r--vendor/term/tests/data/rxvtbin0 -> 2285 bytes
-rw-r--r--vendor/term/tests/data/rxvt-16colorbin0 -> 2497 bytes
-rw-r--r--vendor/term/tests/data/rxvt-256colorbin0 -> 2427 bytes
-rw-r--r--vendor/term/tests/data/rxvt-88colorbin0 -> 2425 bytes
-rw-r--r--vendor/term/tests/data/rxvt-basicbin0 -> 2145 bytes
-rw-r--r--vendor/term/tests/data/rxvt-colorbin0 -> 2229 bytes
-rw-r--r--vendor/term/tests/data/rxvt-cygwinbin0 -> 2251 bytes
-rw-r--r--vendor/term/tests/data/rxvt-cygwin-nativebin0 -> 2269 bytes
-rw-r--r--vendor/term/tests/data/rxvt-xpmbin0 -> 2227 bytes
-rw-r--r--vendor/term/tests/data/screenbin0 -> 1587 bytes
-rw-r--r--vendor/term/tests/data/screen-256colorbin0 -> 1912 bytes
-rw-r--r--vendor/term/tests/data/vt100bin0 -> 1190 bytes
-rw-r--r--vendor/term/tests/data/xtermbin0 -> 3412 bytes
-rw-r--r--vendor/term/tests/data/xterm-256colorbin0 -> 3713 bytes
-rw-r--r--vendor/term/tests/terminfo.rs29
31 files changed, 29 insertions, 0 deletions
diff --git a/vendor/term/tests/data/dumb b/vendor/term/tests/data/dumb
new file mode 100644
index 000000000..fd4091a99
--- /dev/null
+++ b/vendor/term/tests/data/dumb
Binary files differ
diff --git a/vendor/term/tests/data/linux b/vendor/term/tests/data/linux
new file mode 100644
index 000000000..b458ffaf9
--- /dev/null
+++ b/vendor/term/tests/data/linux
Binary files differ
diff --git a/vendor/term/tests/data/linux-16color b/vendor/term/tests/data/linux-16color
new file mode 100644
index 000000000..8c2e4768b
--- /dev/null
+++ b/vendor/term/tests/data/linux-16color
Binary files differ
diff --git a/vendor/term/tests/data/linux-basic b/vendor/term/tests/data/linux-basic
new file mode 100644
index 000000000..4f23cb9ad
--- /dev/null
+++ b/vendor/term/tests/data/linux-basic
Binary files differ
diff --git a/vendor/term/tests/data/linux-c b/vendor/term/tests/data/linux-c
new file mode 100644
index 000000000..aa66f83d8
--- /dev/null
+++ b/vendor/term/tests/data/linux-c
Binary files differ
diff --git a/vendor/term/tests/data/linux-c-nc b/vendor/term/tests/data/linux-c-nc
new file mode 100644
index 000000000..da344e0de
--- /dev/null
+++ b/vendor/term/tests/data/linux-c-nc
Binary files differ
diff --git a/vendor/term/tests/data/linux-koi8 b/vendor/term/tests/data/linux-koi8
new file mode 100644
index 000000000..1333f2d9f
--- /dev/null
+++ b/vendor/term/tests/data/linux-koi8
Binary files differ
diff --git a/vendor/term/tests/data/linux-koi8r b/vendor/term/tests/data/linux-koi8r
new file mode 100644
index 000000000..e3cb2a18d
--- /dev/null
+++ b/vendor/term/tests/data/linux-koi8r
Binary files differ
diff --git a/vendor/term/tests/data/linux-lat b/vendor/term/tests/data/linux-lat
new file mode 100644
index 000000000..9a428f96e
--- /dev/null
+++ b/vendor/term/tests/data/linux-lat
Binary files differ
diff --git a/vendor/term/tests/data/linux-m b/vendor/term/tests/data/linux-m
new file mode 100644
index 000000000..65d418012
--- /dev/null
+++ b/vendor/term/tests/data/linux-m
Binary files differ
diff --git a/vendor/term/tests/data/linux-nic b/vendor/term/tests/data/linux-nic
new file mode 100644
index 000000000..84458a5f4
--- /dev/null
+++ b/vendor/term/tests/data/linux-nic
Binary files differ
diff --git a/vendor/term/tests/data/linux-vt b/vendor/term/tests/data/linux-vt
new file mode 100644
index 000000000..42df50d3b
--- /dev/null
+++ b/vendor/term/tests/data/linux-vt
Binary files differ
diff --git a/vendor/term/tests/data/linux2.2 b/vendor/term/tests/data/linux2.2
new file mode 100644
index 000000000..8656939f5
--- /dev/null
+++ b/vendor/term/tests/data/linux2.2
Binary files differ
diff --git a/vendor/term/tests/data/linux2.6 b/vendor/term/tests/data/linux2.6
new file mode 100644
index 000000000..4560270ae
--- /dev/null
+++ b/vendor/term/tests/data/linux2.6
Binary files differ
diff --git a/vendor/term/tests/data/linux2.6.26 b/vendor/term/tests/data/linux2.6.26
new file mode 100644
index 000000000..7b9db4671
--- /dev/null
+++ b/vendor/term/tests/data/linux2.6.26
Binary files differ
diff --git a/vendor/term/tests/data/linux3.0 b/vendor/term/tests/data/linux3.0
new file mode 100644
index 000000000..c61f69626
--- /dev/null
+++ b/vendor/term/tests/data/linux3.0
Binary files differ
diff --git a/vendor/term/tests/data/rxvt b/vendor/term/tests/data/rxvt
new file mode 100644
index 000000000..4d54c3249
--- /dev/null
+++ b/vendor/term/tests/data/rxvt
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-16color b/vendor/term/tests/data/rxvt-16color
new file mode 100644
index 000000000..349701aae
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-16color
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-256color b/vendor/term/tests/data/rxvt-256color
new file mode 100644
index 000000000..355cb6e11
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-256color
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-88color b/vendor/term/tests/data/rxvt-88color
new file mode 100644
index 000000000..91ae94737
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-88color
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-basic b/vendor/term/tests/data/rxvt-basic
new file mode 100644
index 000000000..05474636f
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-basic
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-color b/vendor/term/tests/data/rxvt-color
new file mode 100644
index 000000000..8cf3cd9d9
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-color
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-cygwin b/vendor/term/tests/data/rxvt-cygwin
new file mode 100644
index 000000000..b122aa533
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-cygwin
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-cygwin-native b/vendor/term/tests/data/rxvt-cygwin-native
new file mode 100644
index 000000000..2350014d8
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-cygwin-native
Binary files differ
diff --git a/vendor/term/tests/data/rxvt-xpm b/vendor/term/tests/data/rxvt-xpm
new file mode 100644
index 000000000..e0c77fdc0
--- /dev/null
+++ b/vendor/term/tests/data/rxvt-xpm
Binary files differ
diff --git a/vendor/term/tests/data/screen b/vendor/term/tests/data/screen
new file mode 100644
index 000000000..895f0f679
--- /dev/null
+++ b/vendor/term/tests/data/screen
Binary files differ
diff --git a/vendor/term/tests/data/screen-256color b/vendor/term/tests/data/screen-256color
new file mode 100644
index 000000000..11fbb23a8
--- /dev/null
+++ b/vendor/term/tests/data/screen-256color
Binary files differ
diff --git a/vendor/term/tests/data/vt100 b/vendor/term/tests/data/vt100
new file mode 100644
index 000000000..d9d7ead9d
--- /dev/null
+++ b/vendor/term/tests/data/vt100
Binary files differ
diff --git a/vendor/term/tests/data/xterm b/vendor/term/tests/data/xterm
new file mode 100644
index 000000000..12ad5b33a
--- /dev/null
+++ b/vendor/term/tests/data/xterm
Binary files differ
diff --git a/vendor/term/tests/data/xterm-256color b/vendor/term/tests/data/xterm-256color
new file mode 100644
index 000000000..470fbd467
--- /dev/null
+++ b/vendor/term/tests/data/xterm-256color
Binary files differ
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());
+}