From d1b2d29528b7794b41e66fc2136e395a02f8529b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:35 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- library/test/src/term/terminfo/searcher/tests.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'library/test/src/term') diff --git a/library/test/src/term/terminfo/searcher/tests.rs b/library/test/src/term/terminfo/searcher/tests.rs index 4227a585e..e1edd3b25 100644 --- a/library/test/src/term/terminfo/searcher/tests.rs +++ b/library/test/src/term/terminfo/searcher/tests.rs @@ -6,14 +6,12 @@ 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; - // FIXME (#9639): This needs to handle non-utf8 paths - fn x(t: &str) -> String { - let p = get_dbpath_for_term(t).expect("no terminfo entry found"); - p.to_str().unwrap().to_string() + fn x(t: &str) -> PathBuf { + get_dbpath_for_term(t).expect(&format!("no terminfo entry found for {t:?}")) } - assert!(x("screen") == "/usr/share/terminfo/s/screen"); - assert!(get_dbpath_for_term("") == None); + assert_eq!(x("screen"), PathBuf::from("/usr/share/terminfo/s/screen")); + assert_eq!(get_dbpath_for_term(""), None); env::set_var("TERMINFO_DIRS", ":"); - assert!(x("screen") == "/usr/share/terminfo/s/screen"); + assert_eq!(x("screen"), PathBuf::from("/usr/share/terminfo/s/screen")); env::remove_var("TERMINFO_DIRS"); } -- cgit v1.2.3