blob: ff532a97d5eb9f18bf39bf096cae0ebc74aa3fbd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
use super::*;
#[test]
#[ignore = "buildbots don't have ncurses installed and I can't mock everything I need"]
fn test_get_dbpath_for_term() {
// woefully inadequate test coverage
// note: current tests won't work with non-standard terminfo hierarchies (e.g., macOS's)
use std::env;
fn x(t: &str) -> PathBuf {
get_dbpath_for_term(t).expect(&format!("no terminfo entry found for {t:?}"))
}
assert_eq!(x("screen"), PathBuf::from("/usr/share/terminfo/s/screen"));
assert_eq!(get_dbpath_for_term(""), None);
unsafe {
env::set_var("TERMINFO_DIRS", ":");
}
assert_eq!(x("screen"), PathBuf::from("/usr/share/terminfo/s/screen"));
unsafe {
env::remove_var("TERMINFO_DIRS");
}
}
|