File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,19 @@ def check_expected_files(dir_path: Path):
9393 expected_file = test_dir / f"expected.{ rel_path } "
9494 assert expected_file .exists (), f"Expected file not found: { expected_file } "
9595
96- expected_content = f"[ { rel_path } ] \n " + expected_file . read_text ( )
97- result_content = f"[ { rel_path } ] \n " + path . read_text ( )
98- assert result_content . strip () == expected_content . strip () , \
96+ expected_content = file_to_lines ( expected_file , rel_path )
97+ actual_content = file_to_lines ( path , rel_path )
98+ assert actual_content == expected_content , \
9999 f"Output does not match expected content for { rel_path } "
100100
101101 check_expected_files (editor .root_path )
102102
103103 except Exception :
104104 editor ._failed = True # Mark as failed to preserve temp directory
105105 raise
106+
107+
108+ def file_to_lines (file_path , rel_path ):
109+ expected_content = [f"#{ i } [{ rel_path } ]{ c } " for i , c in enumerate (file_path .read_text ().splitlines ())]
110+ return expected_content
111+
You can’t perform that action at this time.
0 commit comments