exa/src/output/render/inode.rs

29 lines
542 B
Rust
Raw Normal View History

use ansi_term::Style;
2017-05-22 07:51:34 +00:00
use output::cell::TextCell;
use fs::fields as f;
impl f::Inode {
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");
assert_eq!(expected, io.render(Cyan.underline()).into());
2017-05-22 07:51:34 +00:00
}
}