mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-04-19 19:34:24 +02:00
test(dynamic string): test pango attributes with ironvars
This commit is contained in:
parent
4d9d78f4ca
commit
af7e037dd5
1 changed files with 14 additions and 0 deletions
|
@ -316,4 +316,18 @@ mod tests {
|
|||
matches!(&tokens[0], DynamicStringSegment::Script(script) if script.cmd == "echo #hello")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_pango_attribute() {
|
||||
const INPUT: &str = "<span color='#color'>hello</span>";
|
||||
let (tokens, _) = parse_input(INPUT);
|
||||
|
||||
assert_eq!(tokens.len(), 3);
|
||||
|
||||
assert!(matches!(&tokens[0], DynamicStringSegment::Static(str) if str == "<span color='"));
|
||||
assert!(
|
||||
matches!(&tokens[1], DynamicStringSegment::Variable(var) if var.to_string() == "color")
|
||||
);
|
||||
assert!(matches!(&tokens[2], DynamicStringSegment::Static(str) if str == "'>hello</span>"))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue