freebsd-dev/usr.bin/diff/tests
Kyle Evans 8bf187f35b diff: fix side-by-side output with tabbed input
The previous logic conflated some things... in this block:
- j: input characters rendered so far
- nc: number of characters in the line
- col: columns rendered so far
- hw: column width ((h)ard (w)idth?)

Comparing j to hw or col to nc are naturally wrong, as col and hw are
limits on their respective counters and nc is already brought down to hw
if the input line should be truncated to start with.

Right now, we end up easily truncating lines with tabs in them as we
count each tab for $tabwidth lines in the input line, but we really
should only be accounting for them in the column count.  The problem is
most easily demonstrated by the two input files added for the tests,
the two tabbed lines lose at least a word or two even though there's
plenty of space left in the row for each side.

Reviewed by:	bapt, pstef
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37676
2022-12-13 19:31:21 -06:00
..
Bflag_C.out
Bflag_D.out
Bflag_F.out
diff_test.sh diff: fix side-by-side output with tabbed input 2022-12-13 19:31:21 -06:00
functionname_c.in diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
functionname_c.out diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
functionname_objcclassm.in diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
functionname_objcclassm.out diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
functionname_objcm.in diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
functionname_objcm.out diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
functionname.in diff: Detect Objective-C methods 2022-02-18 15:09:57 +00:00
group-format.out
header_ns.out
header.out
ifdef.out
input1.in
input2.in
input_c1.in
input_c2.in
Makefile diff: fix side-by-side output with tabbed input 2022-12-13 19:31:21 -06:00
Makefile.depend
side_by_side_tabbed_a.in diff: fix side-by-side output with tabbed input 2022-12-13 19:31:21 -06:00
side_by_side_tabbed_b.in diff: fix side-by-side output with tabbed input 2022-12-13 19:31:21 -06:00
simple_b.out
simple_e.out
simple_i.out
simple_n.out
simple_p.out
simple_u.out
simple_w.out
simple.out
strip_o.out diff: don't output carriage returns that were stripped on input 2021-08-23 07:04:28 +02:00
unified_9999.out
unified_c9999.out
unified_p.out