summaryrefslogtreecommitdiffstats
path: root/src/output/render/inode.rs
blob: 8bb3249dab7d42337c533034597d83b4fbf8742a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use ansi_term::Style;

use crate::fs::fields as f;
use crate::output::cell::TextCell;


impl f::Inode {
    pub fn render(self, style: Style) -> TextCell {
        TextCell::paint(style, self.0.to_string())
    }
}


#[cfg(test)]
pub mod test {
    use crate::output::cell::TextCell;
    use crate::fs::fields as f;

    use ansi_term::Colour::*;


    #[test]
    fn blocklessness() {
        let io = f::Inode(1_414_213);
        let expected = TextCell::paint_str(Cyan.underline(), "1414213");
        assert_eq!(expected, io.render(Cyan.underline()));
    }
}