Niklas Mohrin
b8a18d3ebb
Use tempfiles for clircle tests
4 years ago
Martin Nordholts
3af3549232
integration_tests: Use tempdir() in config_location_when_generating
...
For cleaner code.
Use the tempdir() function since that is recommended by the crate docs:
https://docs.rs/tempfile/3.2.0/tempfile/index.html
4 years ago
Martin Nordholts
643f0bcbe3
integration_tests.rs: Add test config_location_when_generating
...
As a complement to #1556 to prevent #1550 from coming back.
The test purposefully fails if ca60937c2e
is reverted.
4 years ago
David Peter
ca60937c2e
Do not ignore non-existent BAT_CONFIG_PATH
...
Do not ignore `BAT_CONFIG_PATH` if it doesn't exist. Both when
generating a new config file with `--generate-config-file` and
when attempting to read the config.
Also, provide a better error message in case the file can not
be created.
closes #1550
4 years ago
Caden Haustein
573f34d757
Update dependencies; replace unmaintained ( #1522 )
...
* Update dependencies; replace unmaintained
* Fix errors
* Revert dependency changes
* Revert git2 to 0.13.15
Co-authored-by: David Peter <mail@david-peter.de>
4 years ago
Martin Nordholts
dd0d44bbb3
Fix #1413 Can't use `bat` at all! (Error: Use of bat as a pager is disallowed...)
...
Fixed by implementing the proposal by sharkdp:
* Allow PAGER=bat, but ignore the setting in bat and simply default to
less. Unless of course, BAT_PAGER or --pager is used to overwrite the
value of PAGER.
* Disallow the usage of bat within BAT_PAGER and --pager.
4 years ago
Martin Nordholts
eda72c31b2
tests: Move 'mocked pagers' utils to separate file
4 years ago
Martin Nordholts
c2c2b0211a
fn mocked_pager: Simplify with format!
4 years ago
Martin Nordholts
dd6f57e107
pager.rs: Some comment fixups
4 years ago
Martin Nordholts
da10166625
Merge remote-tracking branch 'origin/master' into fix-1063
4 years ago
sharkdp
35e3c51b75
Fix unused import warning
4 years ago
sharkdp
59c9105c25
Fix clippy warnings in tests on Windows
4 years ago
Martin Nordholts
46487b201f
Merge remote-tracking branch 'origin/master' into fix-1063
4 years ago
Martin Nordholts
9ccb667653
Add integration test for unparsable pager
...
Right now all tests pass even if we e.g. return
Ok(OutputType::stdout())
instead of doing
.chain_err(|| "Could not parse pager command.")?
so add a test to make sure this functionality don't break.
4 years ago
Niklas Mohrin
b600f62ab6
Add unix specific integration test about running bat without any arguments
4 years ago
Niklas Mohrin
ace655e164
Add integration tests for clircle cycle detection
4 years ago
Martin Nordholts
e87c554ccd
tests: Make mocked pagers work on Windows
4 years ago
Martin Nordholts
df33ed05dd
Run PATH-dependent tests serially
...
Since PATH is a shared resource.
4 years ago
Martin Nordholts
c9efdd68ed
Add integration tests for 'more' and 'most' used as pagers
4 years ago
Martin Nordholts
22bdc7c20f
When PAGER=most, don't print a warning to stderr, silently use less instead
4 years ago
Martin Nordholts
dcfe883f4b
Simplify and polish pager.rs and related code
4 years ago
Martin Nordholts
cc0f8ca813
Merge remote-tracking branch 'origin/master' into fix-1063
4 years ago
Martin Nordholts
a63bb08eda
Add test 'grid_for_file_without_newline' (for issue #299 fix)
...
This is a regression test for the fix for issue #299 . If that fix is
reverted, currently only one test ('header_padding') fails. But that
test is for a different use case, so add a dedicated regression test for
the particular use case issue #299 is about.
4 years ago
sharkdp
3e9afe2974
Add integration test for nonexisting newline
4 years ago
Martin Nordholts
986d0e9777
Ignore PAGER=most by default with a warning to stderr
...
closes #1063
4 years ago
sharkdp
bd2e9917da
Revert "Add cycle detection integration tests"
...
This reverts commit ec60d84265
.
4 years ago
Niklas Mohrin
4f0116bee7
Add cycle detection integration tests
4 years ago
Ethan P
61f947a580
Merge pull request #1276 from tommilligan/style-rule
...
style: add component 'rule' for horizontal file delimiter
4 years ago
Adrian Rivera
9837948c3a
Throws an error when `bat` is being user as pager.
...
As mentioned on #1334 `bat` should not be used as a value for `pager`,
this change checks both the balue of `bat` provided as a parameter or
as an environment variable.
4 years ago
Tom Milligan
1614f80366
add integration test for grid overriding rule
4 years ago
Tom Milligan
c1af6ff2e6
Add integration test for style rule
4 years ago
Tom Milligan
aa4000cb0d
style: add component 'rule' for horizontal file delimiter
4 years ago
sharkdp
71b2089384
Code formatting
4 years ago
Dash Peters
6faf61552e
Fix integration test
4 years ago
Dash Peters
f53ea60ed4
Merge remote-tracking branch 'sharkdp/master'
4 years ago
Evgeniy Andreev (gsomix)
3c5ce9f86c
Enable non-printable chars for redirected output ( #1061 )
4 years ago
Dash Peters
bfac6fd85c
Add integration tests
4 years ago
Roy Ivy III
92e93682c6
Revert f8ed8aa7
(add test instrumentation to help understand failing tests) per PR feedback/owner request
...
- reverts commit f8ed8aa74b
4 years ago
Roy Ivy III
4840c7cd78
Tests ~ add predicate normalization for tests using `echo`
4 years ago
Roy Ivy III
71ab4a2058
Tests ~ revert to `echo` (after fixed 'windows' pager process execution)
4 years ago
Roy Ivy III
01af28b781
Tests ~ add instrumentation to visualize text differences in failing tests
4 years ago
Roy Ivy III
3a7743ffc5
Tests ~ `echo` has portability issues; for CI, replace with `printf`
...
- using `echo` on 'windows' platforms requires process execution indirectly via the shell
- `printf` is available on all GHA CI platforms
- `printf` is *not* available on usual 'windows' platforms; so this is just temporizing, awaiting a true fix
4 years ago
Ethan P
b8687bc969
Merge branch 'master' of github.com:sharkdp/bat into string-input
4 years ago
Ethan P
9166c9dd35
Remove unnecessary clone in integration tests
4 years ago
Ethan P
82981c9663
Add regression test for detected syntax differing for stdin and files
4 years ago
Prat T
b3373398e8
Remove padding if the header style is not enabled
4 years ago
Prat T
0040fef215
Add padding above headers when no grid
4 years ago
sharkdp
5449472f15
Remove invalid UTF-8 file from repo, use temp file instead
5 years ago
sharkdp
82e20bfe14
Fix bug for file with invalid-utf8 filenames
5 years ago
sharkdp
03c2281828
Add do-not-panic! regression tests
5 years ago