Commit Graph

323 Commits

Author SHA1 Message Date
Niklas Mohrin b8a18d3ebb Use tempfiles for clircle tests 2021-02-28 23:04:49 +01:00
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
2021-02-28 18:09:44 +01:00
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.
2021-02-28 18:09:44 +01:00
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
2021-02-28 10:08:24 +01:00
Keith Hall 7768433d09 Improve Monokai Extended JSON key color with a patch 2021-02-28 09:55:24 +01:00
David Peter 94496df3b0 Fix broken resolv.conf highlighting
closes #1510

The change in `create_highlighted_versions.py` fixes a "unknown theme
"'1337'" warning. The single quotes were wrong. `bat` was always falling
back to the default theme, so let's use that for now.
2021-02-16 22:15:31 +01:00
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>
2021-02-16 08:50:41 +01:00
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.
2021-01-11 21:56:10 +01:00
Martin Nordholts eda72c31b2 tests: Move 'mocked pagers' utils to separate file 2021-01-10 14:05:39 +01:00
Martin Nordholts c2c2b0211a fn mocked_pager: Simplify with format! 2021-01-10 13:26:40 +01:00
Martin Nordholts dd6f57e107 pager.rs: Some comment fixups 2021-01-10 13:25:18 +01:00
Martin Nordholts 02e6ff4183 Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-10 11:56:03 +01:00
sharkdp 4c523af1ab Add gnuplot syntax
closes #1431
2021-01-09 22:35:50 +01:00
sharkdp 6d27df3b77 Use unstable sort for theme test 2021-01-09 19:43:39 +01:00
sharkdp 73d14f4655 Use BatTester::default instead of BatTester::new 2021-01-09 19:43:39 +01:00
Martin Nordholts da10166625 Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-07 12:58:26 +01:00
sharkdp 35e3c51b75 Fix unused import warning 2021-01-06 22:09:22 +01:00
sharkdp 59c9105c25 Fix clippy warnings in tests on Windows 2021-01-06 22:08:14 +01:00
Martin Nordholts 46487b201f Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-06 14:30:55 +01:00
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.
2021-01-06 11:58:08 +01:00
Niklas Mohrin b600f62ab6 Add unix specific integration test about running bat without any arguments 2021-01-05 18:21:16 +01:00
Niklas Mohrin ace655e164 Add integration tests for clircle cycle detection 2021-01-05 18:21:16 +01:00
Martin Nordholts 478233f795 Merge remote-tracking branch 'origin/master' into fix-1063 2021-01-04 21:02:51 +01:00
Martin Nordholts e87c554ccd tests: Make mocked pagers work on Windows 2021-01-04 20:22:04 +01:00
Martin Nordholts df33ed05dd Run PATH-dependent tests serially
Since PATH is a shared resource.
2021-01-04 15:45:57 +01:00
Martin Nordholts c9efdd68ed Add integration tests for 'more' and 'most' used as pagers 2021-01-04 10:30:55 +01:00
Ethan P 1b549ecc66
Merge branch 'master' into improved-benchmark 2021-01-02 21:35:58 -08:00
sharkdp b5bdba8b16 Svelte syntax test: rename license file 2021-01-02 22:34:15 +01:00
sharkdp 522c97f5ad DotEnv syntax test: add missing newline 2021-01-02 22:34:15 +01:00
sharkdp b3f34529b5 Update Zig syntax test output 2021-01-02 21:34:25 +01:00
Paul Smith c76e27851c Add support for Zig
Adds syntax support for source code for the Zig programming
language. https://ziglang.org/
2021-01-02 21:34:25 +01:00
Julian Berman af8a8035e8 Add a Lean highlighting test file. 2021-01-02 09:45:19 +01:00
Martin Nordholts 22bdc7c20f When PAGER=most, don't print a warning to stderr, silently use less instead 2020-12-30 08:25:39 +01:00
Ethan P 3ed0081f1f
Improve benchmark script to support cargo/config target-dir 2020-12-29 15:07:22 -08:00
Martin Nordholts dcfe883f4b Simplify and polish pager.rs and related code 2020-12-28 22:39:34 +01:00
Martin Nordholts cc0f8ca813 Merge remote-tracking branch 'origin/master' into fix-1063 2020-12-28 21:57:38 +01:00
Ensar Sarajčić 29ea396c31 Improve VimL regex highlighting
**NOTES:**
- PR is not yet merged in upstream repository (https://github.com/SalGnt/Sublime-VimL/pull/12),
but sublime-syntax file is already updated with changes.
- Updated syntax test files are added as well

This fixes #1064
2020-12-28 09:33:32 +01:00
Ensar Sarajčić 171d215f91 Add case from #1604 to VimL syntax-test source 2020-12-28 09:33:32 +01:00
Ensar Sarajčić cc6109a751 Add syntax highlighting tests for VimL
Adds a syntax highlighting test for VimL
with source file based on parts of my own configuration
changed to cover as much of syntax as possible.

**NOTES:**
Last line of source (`syntax enable`) does not get highlighted,
since `syntax` keyword is not part of highlighting rules.

Related to #1213
2020-12-28 09:33:32 +01:00
John Meow 3d07dec8fd Use Briles/gruvbox .tmTheme files instead of peaceant's port 2020-12-21 21:52:04 +01:00
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.
2020-12-21 21:45:34 +01:00
sharkdp e0207f8167 Fix test 2020-12-21 17:05:10 +01:00
David Peter cc7b89faf8
Merge pull request #1440 from Enselic/fix-1438-newline-can-be-added-even-if-style-plain
Don't add artificial newline to last line if --style=plain
2020-12-21 09:24:26 +01:00
VeryTastyTomato 973ea984c8 fix: warnings of ShellCheck
SC2155: Declare and assign separately to avoid masking return values.
SC2164: Use cd ... || exit in case cd fails.
SC2230: which is non-standard. Use builtin 'command -v' instead.
2020-12-21 09:08:54 +01:00
sharkdp 3e9afe2974 Add integration test for nonexisting newline 2020-12-21 08:34:22 +01:00
David Peter 73c16574e6
Merge branch 'master' into fix-1438-newline-can-be-added-even-if-style-plain 2020-12-21 08:22:01 +01:00
Martin Nordholts 60e00d49a9
Fix #1443 macOS: regression_test.sh: mktemp: illegal option (#1444)
The macOS version of mktemp does not recognize the --suffix option.
Using pure -d should work since, it seems [1], macOS 10.11 however.

So to make the script work on macOS, stop using the --suffix option.

The downside is of course that the temporary dir will have an anonymous
name, but I see no risk of confusion given how short-lived the usage of
the dir is, and given the context it is used.

[1] https://unix.stackexchange.com/questions/30091/fix-or-alternative-for-mktemp-in-os-x
2020-12-21 08:16:49 +01:00
Martin Nordholts 68d525cd8b Don't add artificial newline to last line if --style=plain
This fixes #1438.

Note however, that using a pager such as less will add a newline itself.
So to actually not print a newline for such files, you need to either
disable paging:

  bat --style=plain --paging=never no-newline-at-end-of-file.txt

or use a "pager" that does not add a newline:

  bat --style=plain --pager=cat no-newline-at-end-of-file.txt

Note that we also update syntax tests file since a bunch of them had
missing newlines on the last lines.
2020-12-19 10:32:50 +01:00
Martin Nordholts 986d0e9777 Ignore PAGER=most by default with a warning to stderr
closes #1063
2020-11-27 06:47:46 +01:00
sharkdp bd2e9917da Revert "Add cycle detection integration tests"
This reverts commit ec60d84265.
2020-11-24 21:40:11 +01:00