Skip to content

Commit eb57dff

Browse files
committed
fixing format_tools
1 parent 22c36e1 commit eb57dff

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

module/core/format_tools/tests/inc/tabe_foreign_test.rs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fn iterator_over_optional_cow()
3030
OptionalCow,
3131
};
3232

33+
#[ derive( Debug, Clone ) ]
3334
pub struct TestObjecWrap( TestObjectWithoutImpl );
3435

3536
// xxx : that should fail
@@ -75,23 +76,23 @@ fn iterator_over_optional_cow()
7576
;
7677

7778
use the_module::TableFormatter;
78-
// let _as_table : AsTable< '_, Vec< TestObjecWrap >, &str, TestObjectWithoutImpl, str> = AsTable::new( &data );
79-
// let as_table = AsTable::new( &data );
80-
81-
// let rows = TableRows::rows( &as_table );
82-
// assert_eq!( rows.len(), 2 );
83-
//
84-
// let mut output = String::new();
85-
// let mut context = the_module::print::Context::new( &mut output, Default::default() );
86-
// let _got = the_module::TableFormatter::fmt( &as_table, &mut context );
87-
// let got = as_table.table_to_string();
88-
// assert!( got.contains( "│ id │ created_at │ file_ids │ tools │" ) );
89-
// assert!( got.contains( "│ 13 │ [ │ [ │" ) );
90-
// assert!( got.contains( "│ 1627845583 │ [ │ │" ) );
91-
//
92-
// let got = AsTable::new( &data ).table_to_string();
93-
// assert!( got.contains( "│ id │ created_at │ file_ids │ tools │" ) );
94-
// assert!( got.contains( "│ 13 │ [ │ [ │" ) );
95-
// assert!( got.contains( "│ 1627845583 │ [ │ │" ) );
79+
let _as_table : AsTable< '_, Vec< TestObjecWrap >, &str, TestObjecWrap, str > = AsTable::new( &data );
80+
let as_table = AsTable::new( &data );
81+
82+
let rows = TableRows::rows( &as_table );
83+
assert_eq!( rows.len(), 2 );
84+
85+
let mut output = String::new();
86+
let mut context = the_module::print::Context::new( &mut output, Default::default() );
87+
let _got = the_module::TableFormatter::fmt( &as_table, &mut context );
88+
let got = as_table.table_to_string();
89+
assert!( got.contains( "│ id │ created_at │ file_ids │ tools │" ) );
90+
assert!( got.contains( "│ 13 │ [ │ [ │" ) );
91+
assert!( got.contains( "│ 1627845583 │ [ │ │" ) );
92+
93+
let got = AsTable::new( &data ).table_to_string();
94+
assert!( got.contains( "│ id │ created_at │ file_ids │ tools │" ) );
95+
assert!( got.contains( "│ 13 │ [ │ [ │" ) );
96+
assert!( got.contains( "│ 1627845583 │ [ │ │" ) );
9697

9798
}

0 commit comments

Comments
 (0)