Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration tests running bat with empty input files. #500

Merged
merged 1 commit into from
Feb 8, 2019

Conversation

reidwagner
Copy link
Contributor

Relates to discussion on PR #492.

@sharkdp sharkdp merged commit cec9cc0 into sharkdp:master Feb 8, 2019
@sharkdp
Copy link
Owner

sharkdp commented Feb 8, 2019

Thank you very much!

One thing I noticed after releasing 0.10 is that there is a change in behavior with your implementation in #492 regarding empty files:

If you call bat test.txt empty.txt test.txt on an interactive terminal (where it prints everything with grid, line numbers, header, etc.), you get this:

▶ bat test.txt empty.txt test.txt 
───────┬───────────────────────────────────────────
       │ File: test.txt
───────┼───────────────────────────────────────────
   1   │ hello world
───────┴───────────────────────────────────────────
───────┬───────────────────────────────────────────
       │ File: test.txt
───────┼───────────────────────────────────────────
   1   │ hello world
───────┴───────────────────────────────────────────

I believe that previous versions of bat would have printed the file header. Like this:

▶ bat test.txt empty.txt test.txt 
───────┬───────────────────────────────────────────
       │ File: test.txt
───────┼───────────────────────────────────────────
   1   │ hello world
───────┴───────────────────────────────────────────
───────┬───────────────────────────────────────────
       │ File: empty.txt
───────┴───────────────────────────────────────────
───────┬───────────────────────────────────────────
       │ File: test.txt
───────┼───────────────────────────────────────────
   1   │ hello world
───────┴───────────────────────────────────────────

It's not really that important, but I think it would be nice to get this behavior back. To check for this in an integration test, we could call something like:

bat --style=header --decorations=always empty.txt

and make sure that the header is there.

@reidwagner
Copy link
Contributor Author

Ah, I didn't notice that. I'll take a look ASAP. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants