Skip to content

Commit

Permalink
add a regression test for alignment of decimal numbers with commas (PR
Browse files Browse the repository at this point in the history
astanin committed Feb 17, 2021
1 parent 2619a81 commit da81abb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_regression.py
Original file line number Diff line number Diff line change
@@ -272,6 +272,18 @@ def test_alignment_of_decimal_numbers_with_ansi_color():
assert_equal(result, expected)


def test_alignment_of_decimal_numbers_with_commas():
"Regression: alignment for decimal numbers with comma separators"
stuff={"first": ["c1r1", "c1r2"], "second": [14502.05, 105]}
result = tabulate(stuff, tablefmt="grid", floatfmt=',.2f')
expected = "\n".join(
['+------+-----------+', '| c1r1 | 14,502.05 |',
'+------+-----------+', '| c1r2 | 105.00 |',
'+------+-----------+']
)
assert_equal(result, expected)


def test_long_integers():
"Regression: long integers should be printed as integers (issue #48)"
table = [[18446744073709551614]]

0 comments on commit da81abb

Please sign in to comment.