@@ -322,3 +322,34 @@ fn pager_disable() {
322322 .success()
323323 .stdout("hello world\n");
324324}
325+
326+fn bat_config() -> Command {
327+ let mut cmd = Command::main_binary().unwrap();
328+ cmd.current_dir("tests/examples");
329+ cmd.env_remove("BAT_PAGER");
330+ cmd.env_remove("BAT_CONFIG_PATH");
331+ cmd
332+}
333+
334+#[test]
335+fn config_location_test() {
336+ bat_config()
337+ .env_remove("BAT_CONFIG_PATH")
338+ .env("BAT_CONFIG_PATH", "bat.conf")
339+ .arg("--config-file")
340+ .assert()
341+ .success()
342+ .stdout("bat.conf\n");
343+}
344+
345+#[test]
346+fn config_read_paging_test() {
347+ bat_config()
348+ .env_remove("BAT_CONFIG_PATH")
349+ .env("BAT_CONFIG_PATH", "bat.conf")
350+ .env("BAT_PAGER", "echo testing-config-file")
351+ .arg("test.txt")
352+ .assert()
353+ .success()
354+ .stdout("testing-config-file\n");
355+}