Skip to content

Commit 86b69d4

Browse files
(debug): Adding test_name attribute to test runners input
Also making sure it does not get used in CARIO_FIX_TESTS
1 parent 1c2c2a2 commit 86b69d4

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

crates/cairo-lang-test-utils/src/parse_test_file.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ pub fn dump_to_test_file(
102102
for (test_name, test) in tests {
103103
let mut tag_strings = vec![TAG_PREFIX.to_string() + &test_name];
104104
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-
);
105+
if tag != "test_name" {
106+
tag_strings.push(
107+
TAG_PREFIX.to_string()
108+
+ &tag
109+
+ if content.is_empty() { "" } else { "\n" }
110+
+ &content,
111+
);
112+
}
111113
}
112114
test_strings.push(tag_strings.join("\n\n"));
113115
}
@@ -139,8 +141,11 @@ impl TestBuilder {
139141
}
140142

141143
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 });
144+
self.current_test_name = Some(line.clone());
145+
self.current_test = Some(Test {
146+
attributes: OrderedHashMap::from([("test_name".to_string(), line)]),
147+
line_num,
148+
});
144149
}
145150

146151
fn add_content_line(&mut self, line: String) {

0 commit comments

Comments
 (0)