Age | Commit message (Collapse) | Author |
|
* Fix clippy warnings
- `clippy::uninlined_format_args`
* Fix clippy warnings
- `clippy::clone_on_copy`
- `clippy::explicit_auto_deref`
- `clippy::iter_cloned_collect`
- `clippy::map_clone`
- `clippy::needless_borrow`
- `clippy::needless_lifetimes`
- `clippy::needless_return`
- `clippy::redundant_clone`
- `clippy::redundant_field_names`
- `clippy::seek_to_start_instead_of_rewind`
- `clippy::unnecessary_cast`
- `clippy::unused_unit`
|
|
* try fix bad alignment in unicode (#1144)
* use width instead of count in wrap_line
* fix fmt
* 3 tests do not need fail
* fix tests
Co-authored-by: Thomas Otto <th1000s@posteo.net>
|
|
|
|
There is no such thing as "Center Align" with discrete terminal cells. In
some cases a decision has to be made whether to use the left or the right
cell, e.g. when centering one char in 4 cells: "_X__" or "__X_".
The format!() center/^ default is left, but when padding numbers these
are now aligned to the right if required. Strings remain left-aligned.
|
|
Only cloneable when testing, the types git2::Config and
git2::Repository in GitConfig contain C pointers and can't
really be cloned.
|
|
* DeltaTest improvements
- Added .expect_contains(), .expect_raw_contains(), and
.expect_contains_once() member functions to DeltaTestOutput.
These functions also output some helpful debug info when the
assert fails.
- Separated .with_config_and_input() into .with_config() and (the
tweaked) .with_input().
- Made .with_config() create a DeltaTest object (like .with() does).
- Renamed .with() as .with_args().
- Moved .explain_ansi() from DeltaTestOutput to DeltaTest, which must
now be called prior to .with_input() since the latter stashes off both
the raw_output & the processed output in the object.
- Changed .expect() and .expect_skip() to return Self so that they can
continue a chain of multiple expect calls (e.g. a series of partial
matches with different skip values).
- The processed output text can be accessed via `test_obj.output` (see
also `test_obj.raw_output`).
- Renamed .expect_skip() to .expect_after_skip().
- Changed .expect() to start at the first line.
- Added .expect_after_header() that works like the old .expect().
- Renamed lines_match() to assert_lines_match() and made it match all
lines (no skip number).
- Added assert_lines_match_after_skip() to work like the old
lines_match() function, but with the .expect_after_skip() arg order.
- Converted some old-style tests into DeltaTest style tests.
- Renamed set_cfg as set_config
|
|
* Refactor: compute raw line and new line state
|
|
Note that currently `cargo clippy --tests` is not checked by the CI runs
|
|
Using a syntax similar to the builder pattern:
`DeltaTest::with([config options]).with_input(DIFF).expect(lines)`
plus `.explain_ansi()` to pretty-print ansi codes and `.inspect()` to
print the to-be-tested output.
Rewrite a few tests using it and add ansi tests for
--line-fill-method=<spaces|ansi>
|
|
|
|
With this commit combined diff
format (https://git-scm.com/docs/git-diff#_combined_diff_format) is
handled appropriately. However, there is no special handling of merge
conflict markers.
Fixes #189, #736
|
|
|
|
|
|
Simplifies line handling and printing by removing a "magical"
1-offset previously required in various locations.
Now explicitly prepend "" in `tokenize()`.
|
|
Make the two panels in side-by-side use the full terminal width by
inserting an extra space in the center between the panels if the
width is odd and ANSI filling is enabled.
Fall back to spaces when the output is not to a terminal.
|
|
|
|
|
|
|
|
If the current line does not fit into the panel, then
it is not truncated but split into multiple lines. A
wrapping symbol is placed at the end of the line. If
the new line is short enough, it is right-aligned.
Wrapping is limited to a certain number of lines
(--wrap-max-lines), if this is exceeded the line is
truncated by a now highlighted truncation symbol.
To disable wrapping set this value to 0.
|