mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
join: fix autoformat
There was an issue with autoformat when the files had a different number of columns in the first line. This commit fixes the issue and extends the related test to cover this case.
This commit is contained in:
parent
cd98478ce9
commit
4b8d4bfc05
3 changed files with 7 additions and 7 deletions
|
@ -327,7 +327,7 @@ impl<'a> State<'a> {
|
|||
} else {
|
||||
repr.print_field(key);
|
||||
repr.print_fields(&line1, self.key, self.max_fields);
|
||||
repr.print_fields(&line2, other.key, self.max_fields);
|
||||
repr.print_fields(&line2, other.key, other.max_fields);
|
||||
}
|
||||
|
||||
println!();
|
||||
|
|
10
tests/fixtures/join/autoformat.expected
vendored
10
tests/fixtures/join/autoformat.expected
vendored
|
@ -1,5 +1,5 @@
|
|||
1 a a
|
||||
2 b b
|
||||
3 c d
|
||||
4 d g
|
||||
5 e i
|
||||
1 a a b
|
||||
2 b b c
|
||||
3 c d e
|
||||
4 d g h
|
||||
5 e i
|
||||
|
|
2
tests/fixtures/join/different_lengths.txt
vendored
2
tests/fixtures/join/different_lengths.txt
vendored
|
@ -1,4 +1,4 @@
|
|||
1 a
|
||||
1 a b
|
||||
2 b c
|
||||
3 d e f
|
||||
4 g h
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue