2017-08-20 19:29:23 +00:00
|
|
|
use ansi_term::Style;
|
|
|
|
|
2017-05-22 07:51:34 +00:00
|
|
|
use output::cell::TextCell;
|
|
|
|
use fs::fields as f;
|
|
|
|
|
|
|
|
|
|
|
|
impl f::Inode {
|
2017-08-20 19:29:23 +00:00
|
|
|
pub fn render(&self, style: Style) -> TextCell {
|
|
|
|
TextCell::paint(style, self.0.to_string())
|
2017-05-22 07:51:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
pub mod test {
|
|
|
|
use output::cell::TextCell;
|
|
|
|
use fs::fields as f;
|
|
|
|
|
|
|
|
use ansi_term::Colour::*;
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn blocklessness() {
|
|
|
|
let io = f::Inode(1414213);
|
|
|
|
let expected = TextCell::paint_str(Cyan.underline(), "1414213");
|
2017-08-20 19:29:23 +00:00
|
|
|
assert_eq!(expected, io.render(Cyan.underline()).into());
|
2017-05-22 07:51:34 +00:00
|
|
|
}
|
|
|
|
}
|