diff options
author | pierresy <pierre-henri.symoneaux@alcatel-lucent.com> | 2015-11-19 14:48:35 +0100 |
---|---|---|
committer | pierresy <pierre-henri.symoneaux@alcatel-lucent.com> | 2015-11-19 14:48:35 +0100 |
commit | eb3fb2b5367ac0a1c420b9ef7f3feb66cd9afb5c (patch) | |
tree | f54f4920377df8cf5a5e6118736690fe6c0f35f8 /src/cell.rs | |
parent | 1c0647c8bb9ed857fb32712f95df2e039224a09e (diff) |
Added some unittests on style string
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cell.rs b/src/cell.rs index 31006ff..1ee2f8b 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -258,6 +258,7 @@ mod tests { use cell::Cell;
use utils::StringWriter;
use format::Align;
+ use term::{Attr, color};
#[test]
fn ascii() {
@@ -302,5 +303,16 @@ mod tests { let _ = cell.print(&mut out, 0, 10);
assert_eq!(out.as_string(), " test ");
}
+
+ #[test]
+ fn style_spec() {
+ let cell = Cell::new("test").style_spec("FrBBbuic");
+ assert!(cell.style.contains(&Attr::Underline(true)));
+ assert!(cell.style.contains(&Attr::Italic(true)));
+ assert!(cell.style.contains(&Attr::Bold));
+ assert!(cell.style.contains(&Attr::ForegroundColor(color::RED)));
+ assert!(cell.style.contains(&Attr::BackgroundColor(color::BRIGHT_BLUE)));
+ assert_eq!(cell.align, Align::CENTER);
+ }
}
|