Skip to content

Commit 128cc06

Browse files
authored
Rollup merge of #114377 - Enselic:test_get_dbpath_for_term-utf-8, r=thomcc
test_get_dbpath_for_term(): handle non-utf8 paths (fix FIXME) Removes a FIXME for #9639 Part of #44366 which is E-help-wanted The remaining two FIXMEs for #9639 are considerably more complicated, so I will create separate PRs for them.
2 parents 7d78885 + d194091 commit 128cc06

File tree

1 file changed

+5
-7
lines changed
  • library/test/src/term/terminfo/searcher

1 file changed

+5
-7
lines changed

Diff for: library/test/src/term/terminfo/searcher/tests.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ fn test_get_dbpath_for_term() {
66
// woefully inadequate test coverage
77
// note: current tests won't work with non-standard terminfo hierarchies (e.g., macOS's)
88
use std::env;
9-
// FIXME (#9639): This needs to handle non-utf8 paths
10-
fn x(t: &str) -> String {
11-
let p = get_dbpath_for_term(t).expect("no terminfo entry found");
12-
p.to_str().unwrap().to_string()
9+
fn x(t: &str) -> PathBuf {
10+
get_dbpath_for_term(t).expect(&format!("no terminfo entry found for {t:?}"))
1311
}
14-
assert!(x("screen") == "/usr/share/terminfo/s/screen");
15-
assert!(get_dbpath_for_term("") == None);
12+
assert_eq!(x("screen"), PathBuf::from("/usr/share/terminfo/s/screen"));
13+
assert_eq!(get_dbpath_for_term(""), None);
1614
env::set_var("TERMINFO_DIRS", ":");
17-
assert!(x("screen") == "/usr/share/terminfo/s/screen");
15+
assert_eq!(x("screen"), PathBuf::from("/usr/share/terminfo/s/screen"));
1816
env::remove_var("TERMINFO_DIRS");
1917
}

0 commit comments

Comments
 (0)