summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/utils.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs
index 78c4d8a..084b48b 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -70,8 +70,7 @@ pub fn find_pager(env: &str) -> Option<OsString> {
#[cfg(test)]
mod tests {
- use super::{find_pager, which};
- use std::ffi::OsString;
+ use super::*;
#[cfg(target_os = "linux")]
const MORE: &'static str = "/bin/more";
@@ -98,4 +97,11 @@ mod tests {
fn usr_bin_more_default_pager() {
assert_eq!(find_pager("__RANDOM_NAME"), Some(OsString::from(MORE)));
}
+
+ #[test]
+ fn nopager() {
+ env::set_var("NOPAGER", "");
+ assert!(find_pager("more").is_none());
+ env::remove_var("NOPAGER");
+ }
}