exa/src/output/render/inode.rs

29 lines
569 B
Rust
Raw Normal View History

use ansi_term::Style;
2018-12-07 23:43:31 +00:00
use crate::fs::fields as f;
use crate::output::cell::TextCell;
2017-05-22 07:51:34 +00:00
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 {
2018-12-07 23:43:31 +00:00
use crate::output::cell::TextCell;
use crate::fs::fields as f;
2017-05-22 07:51:34 +00:00
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
}
}