inode.rs 564 B

12345678910111213141516171819202122232425262728
  1. use ansi_term::Style;
  2. use crate::fs::fields as f;
  3. use crate::output::cell::TextCell;
  4. impl f::Inode {
  5. pub fn render(self, style: Style) -> TextCell {
  6. TextCell::paint(style, self.0.to_string())
  7. }
  8. }
  9. #[cfg(test)]
  10. pub mod test {
  11. use crate::output::cell::TextCell;
  12. use crate::fs::fields as f;
  13. use ansi_term::Colour::*;
  14. #[test]
  15. fn blocklessness() {
  16. let io = f::Inode(1_414_213);
  17. let expected = TextCell::paint_str(Cyan.underline(), "1414213");
  18. assert_eq!(expected, io.render(Cyan.underline()));
  19. }
  20. }