Fix bugs in multiple examples

This commit is contained in:
Timothyxxx
2024-03-11 00:26:59 +08:00
parent 3f21519b78
commit b4cb64d861
2 changed files with 12 additions and 13 deletions

View File

@@ -387,6 +387,9 @@ def is_included_all_json_objects(gold_file_path, result_file_path):
def is_gold_text_included_in_pdf(pdf_file_path, gold_text_path):
if not gold_text_path or not pdf_file_path:
return 0
print("gold_text_path: ")
print(gold_text_path)
print("pdf_file_path: ")
@@ -447,6 +450,9 @@ def check_line_number(file_path, line_number):
def compare_terminal_and_txt(txt_file_path, terminal_output):
if not txt_file_path or not terminal_output:
return 0
# read txt file content
with open(txt_file_path, 'r') as f:
txt_file_content = f.read()
@@ -455,6 +461,9 @@ def compare_terminal_and_txt(txt_file_path, terminal_output):
def compare_python_pure_text(py_file_path, gold_file_path):
if not py_file_path or not gold_file_path:
return 0
# first, change the suffix of gold_file from .txt to .py
print("py_file_path: ")
print(py_file_path)