summaryrefslogtreecommitdiffstats
path: root/src/cell.rs
diff options
context:
space:
mode:
authorpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2015-11-19 15:39:42 +0100
committerpierresy <pierre-henri.symoneaux@alcatel-lucent.com>2015-11-19 15:46:06 +0100
commit991fdebc4b831b1dac18ca6877fa33762d684cde (patch)
treef41e359829d0d08a6dd42ac67c3b22f373986170 /src/cell.rs
parentac4d88acfdee14ba0b1c3a1744dedaa0b0c6fe51 (diff)
Added unittest on table indexing
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cell.rs b/src/cell.rs
index 1ee2f8b..335bcfd 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -165,7 +165,7 @@ impl Cell {
/// Return a copy of the full string contained in the cell
pub fn get_content(&self) -> String {
- return self.content.iter().fold("".to_string(), (|acc, ref item| format!("{}\n{}", acc, item)));
+ return self.content.join("\n");
}
/// Print a partial cell to `out`. Since the cell may be multi-lined,
@@ -259,6 +259,12 @@ mod tests {
use utils::StringWriter;
use format::Align;
use term::{Attr, color};
+
+ #[test]
+ fn get_content() {
+ let cell = Cell::new("test");
+ assert_eq!(cell.get_content(), "test");
+ }
#[test]
fn ascii() {