Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Jan 9, 2025
1 parent 4d73c1e commit 8a11a46
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,46 @@ fn theme_arg_overrides_env_withconfig() {
.stderr("");
}

#[test]
fn theme_light_env_var_is_respected() {
bat()
.env("BAT_THEME_LIGHT", "Coldark-Cold")
.env("COLORTERM", "truecolor")
.arg("--theme=light")
.arg("--paging=never")
.arg("--color=never")
.arg("--terminal-width=80")
.arg("--wrap=never")
.arg("--decorations=always")
.arg("--style=plain")
.arg("--highlight-line=1")
.write_stdin("Lorem Ipsum")
.assert()
.success()
.stdout("\x1B[48;2;208;218;231mLorem Ipsum\x1B[0m")
.stderr("");
}

#[test]
fn theme_dark_env_var_is_respected() {
bat()
.env("BAT_THEME_DARK", "Coldark-Dark")
.env("COLORTERM", "truecolor")
.arg("--theme=dark")
.arg("--paging=never")
.arg("--color=never")
.arg("--terminal-width=80")
.arg("--wrap=never")
.arg("--decorations=always")
.arg("--style=plain")
.arg("--highlight-line=1")
.write_stdin("Lorem Ipsum")
.assert()
.success()
.stdout("\x1B[48;2;33;48;67mLorem Ipsum\x1B[0m")
.stderr("");
}

#[test]
fn theme_env_overrides_config() {
bat_with_config()
Expand Down

0 comments on commit 8a11a46

Please sign in to comment.