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

batdiff test failed with delta 0.18.0 #126

Closed
XYenon opened this issue Aug 21, 2024 · 6 comments
Closed

batdiff test failed with delta 0.18.0 #126

XYenon opened this issue Aug 21, 2024 · 6 comments

Comments

@XYenon
Copy link

XYenon commented Aug 21, 2024

I think the problem is caused by test/shimexec/less can not deal with less options.

./test.sh --failed --snapshot:show --VERBOSE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Test Suite: batdiff                                                                                                                                                                                            |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[FAIL] version              :: Mismatched STDERR snapshot.
 .... Snapshot Difference:
 .... |    1 0a1,4
 .... |    2 > cat: unrecognized option '--RAW-CONTROL-CHARS'
 .... |    3 > Try 'cat --help' for more information.
 .... |    4 > cat: unrecognized option '--RAW-CONTROL-CHARS'
 .... |    5 > Try 'cat --help' for more information.
 .... STDOUT:
 .... |    1 batdiff
 .... |    2 Copyright (C) 2019-2021 eth-p | MIT License
 .... |    3 https://github.com/eth-p/bat-extras
 .... STDERR:
 .... |    1 cat: unrecognized option '--RAW-CONTROL-CHARS'
 .... |    2 Try 'cat --help' for more information.
 .... |    3 cat: unrecognized option '--RAW-CONTROL-CHARS'
 .... |    4 Try 'cat --help' for more information.

Totals:
    PASS: 0 / 1
    FAIL: 1 / 1
@sedlund
Copy link

sedlund commented Aug 21, 2024

this happens with delta enabled which passes --RAW-CONTROL-CHARS

@XYenon
Copy link
Author

XYenon commented Aug 22, 2024

It's weird. I found this is triggered by delta --version.

 .... |  202 > + SUPPORTS_BAT_DIFF=true
 .... |  203 > + command -v delta
 .... |  204 > + SUPPORTS_DELTA=true
 .... |  205 > ++ delta --version
 .... |  206 > ++ cut '-d ' -f2
 .... |  207 > cat: unrecognized option '--RAW-CONTROL-CHARS'
 .... |  208 > Try 'cat --help' for more information.
 .... |  209 > + DELTA_VERSION=
 .... |  210 > + version_compare '' -ge 0.12
 .... |  211 > + local version=
 .... |  212 > + local compare=0.12

@XYenon
Copy link
Author

XYenon commented Aug 22, 2024

It looks like when running delta --version with an empty environment, it will call less.

image

@sedlund
Copy link

sedlund commented Aug 22, 2024

they implemented a function to rewrap lines and are putting everything through it including the --version output

dandavison/delta#1440

i don't see the usefulness of test/shimexec/less -- removing it fixes this test.

webframp added a commit to webframp/dotfiles that referenced this issue Aug 22, 2024
They are incompatible for now but will likely be fixed soon

upstream issue: eth-p/bat-extras#126
@n8henrie
Copy link

Here's the upstream issue: dandavison/delta#1818

@eth-p
Copy link
Owner

eth-p commented Aug 24, 2024

i don't see the usefulness of test/shimexec/less -- removing it fixes this test.

Back when it was originally written, it had two purposes:

  1. To make sure that calling less didn't freeze the tests waiting for less, which itself was waiting for user input.
  2. For mocking the less version, to test different behaviors based around that.

Either way, easy fix.

@eth-p eth-p closed this as completed in 01c2f9b Aug 24, 2024
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

No branches or pull requests

4 participants