blob: 34ac7af0425ad1f40a9526253bfbc487304bb5f6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
mod helpers;
#[test]
fn colors() {
helpers::fixture("colors");
}
#[test]
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");
}
|