diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-09 01:46:51 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-09 01:46:51 -0500 |
commit | c9b957bcdfcd1cedbd8a1f3c5e16d1e4382b54c2 (patch) | |
tree | 34bcb2429f31c404f63139406c0c460b75b37243 /tests | |
parent | 0d69a14a273176c8405602f7543694b65966c7e0 (diff) | |
download | vt100-rust-c9b957bcdfcd1cedbd8a1f3c5e16d1e4382b54c2.tar.gz vt100-rust-c9b957bcdfcd1cedbd8a1f3c5e16d1e4382b54c2.zip |
fix attributes_formatted, remove attributes_diff
also improve the documentation and add more tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/attr.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/attr.rs b/tests/attr.rs index 64f4bd4..34ac7af 100644 --- a/tests/attr.rs +++ b/tests/attr.rs @@ -9,3 +9,15 @@ fn colors() { fn attrs() { helpers::fixture("attrs"); } + +#[test] +fn attributes_formatted() { + let mut parser = vt100::Parser::default(); + assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m"); + parser.process(b"\x1b[32mfoo\x1b[41mbar\x1b[33mbaz"); + assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m\x1b[33;41m"); + parser.process(b"\x1b[1m\x1b[39m"); + assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m\x1b[41;1m"); + parser.process(b"\x1b[m"); + assert_eq!(parser.screen().attributes_formatted(), b"\x1b[m"); +} |