mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 01:58:24 +00:00
rich measure
This commit is contained in:
parent
27379a8f1a
commit
be5e9dca2d
43 changed files with 301 additions and 185 deletions
|
@ -8,7 +8,7 @@ from rich.styled import Styled
|
|||
def test_styled():
|
||||
styled_foo = Styled("foo", "on red")
|
||||
console = Console(file=io.StringIO(), force_terminal=True, _environ={})
|
||||
assert Measurement.get(console, styled_foo, 80) == Measurement(3, 3)
|
||||
assert Measurement.get(console, console.options, styled_foo) == Measurement(3, 3)
|
||||
console.print(styled_foo)
|
||||
result = console.file.getvalue()
|
||||
expected = "\x1b[41mfoo\x1b[0m\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue