exa/src/output/render/inode.rs

32 lines
693 B
Rust
Raw Normal View History

2017-05-22 07:51:34 +00:00
use output::cell::TextCell;
use output::colours::Colours;
use fs::fields as f;
impl f::Inode {
pub fn render(&self, colours: &Colours) -> TextCell {
TextCell::paint(colours.inode, self.0.to_string())
}
}
#[cfg(test)]
pub mod test {
use output::details::Details;
use output::cell::TextCell;
use fs::fields as f;
use ansi_term::Colour::*;
#[test]
fn blocklessness() {
let mut details = Details::default();
details.colours.inode = Cyan.underline();
let io = f::Inode(1414213);
let expected = TextCell::paint_str(Cyan.underline(), "1414213");
assert_eq!(expected, io.render(&details.colours).into());
}
}