Skip to content

Commit 3588894

Browse files
authored
Merge pull request #2786 from andrehora/master
improving tests in test_cells and test_pick
2 parents 465d0ae + 6159830 commit 3588894

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The following people have contributed to the development of Rich:
1818
- [Michał Górny](https://github.com/mgorny)
1919
- [Nok Lam Chan](https://github.com/noklam)
2020
- [Leron Gray](https://github.com/daddycocoaman)
21+
- [Andre Hora](https://github.com/andrehora)
2122
- [Kenneth Hoste](https://github.com/boegel)
2223
- [Lanqing Huang](https://github.com/lqhuang)
2324
- [Finn Hughes](https://github.com/finnhughes)

tests/test_cells.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
def test_cell_len_long_string():
55
# Long strings don't use cached cell length implementation
66
assert cells.cell_len("abc" * 200) == 3 * 200
7+
# Boundary case
8+
assert cells.cell_len("a" * 512) == 512
9+
10+
11+
def test_cell_len_short_string():
12+
# Short strings use cached cell length implementation
13+
assert cells.cell_len("abc" * 100) == 3 * 100
14+
# Boundary case
15+
assert cells.cell_len("a" * 511) == 511
716

817

918
def test_set_cell_size():

tests/test_pick.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33

44
def test_pick_bool():
5+
assert pick_bool(False) == False
6+
assert pick_bool(True) == True
7+
assert pick_bool(None) == False
58
assert pick_bool(False, True) == False
69
assert pick_bool(None, True) == True
710
assert pick_bool(True, None) == True

0 commit comments

Comments
 (0)