@@ -14,6 +14,7 @@ use colored::Colorize;
1414const TAG_PREFIX : & str = "//! > " ;
1515const TEST_SEPARATOR : & str =
1616 "==========================================================================" ;
17+ const TEST_NAME : & str = "test_name" ;
1718
1819#[ derive( Default ) ]
1920struct Tag {
@@ -102,12 +103,14 @@ pub fn dump_to_test_file(
102103 for ( test_name, test) in tests {
103104 let mut tag_strings = vec ! [ TAG_PREFIX . to_string( ) + & test_name] ;
104105 for ( tag, content) in test. attributes {
105- tag_strings. push (
106- TAG_PREFIX . to_string ( )
107- + & tag
108- + if content. is_empty ( ) { "" } else { "\n " }
109- + & content,
110- ) ;
106+ if tag != TEST_NAME {
107+ tag_strings. push (
108+ TAG_PREFIX . to_string ( )
109+ + & tag
110+ + if content. is_empty ( ) { "" } else { "\n " }
111+ + & content,
112+ ) ;
113+ }
111114 }
112115 test_strings. push ( tag_strings. join ( "\n \n " ) ) ;
113116 }
@@ -139,8 +142,11 @@ impl TestBuilder {
139142 }
140143
141144 fn set_test_name ( & mut self , line : String , line_num : usize ) {
142- self . current_test_name = Some ( line) ;
143- self . current_test = Some ( Test { attributes : OrderedHashMap :: default ( ) , line_num } ) ;
145+ self . current_test_name = Some ( line. clone ( ) ) ;
146+ self . current_test = Some ( Test {
147+ attributes : OrderedHashMap :: from ( [ ( TEST_NAME . to_string ( ) , line) ] ) ,
148+ line_num,
149+ } ) ;
144150 }
145151
146152 fn add_content_line ( & mut self , line : String ) {
0 commit comments