From 30ec25cb912f30c42ce7e22f478add061ee0aa32 Mon Sep 17 00:00:00 2001 From: Nathan TeBlunthuis Date: Thu, 7 Aug 2025 17:00:15 -0700 Subject: [PATCH] gix bug in benchmark test. --- mediawiki-php-wikidiff2 | 2 +- test/benchmark_wd2.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/mediawiki-php-wikidiff2 b/mediawiki-php-wikidiff2 index 6736391..7b40de3 160000 --- a/mediawiki-php-wikidiff2 +++ b/mediawiki-php-wikidiff2 @@ -1 +1 @@ -Subproject commit 67363910e579b85dcde855554c077d8adaeff59f +Subproject commit 7b40de3fe9c1011d7b47ca1fd3a24214e54cf6cd diff --git a/test/benchmark_wd2.py b/test/benchmark_wd2.py index fbc1bf5..afedecc 100644 --- a/test/benchmark_wd2.py +++ b/test/benchmark_wd2.py @@ -27,14 +27,12 @@ def stream_text_by_article_streaming(file_path: str) -> Generator[Tuple[Any, Lis print(f"An error occurred: {e}") -last_text = "" -last_article_id = None with open('/dev/null', 'w') as of: - for article_id, text in stream_text_by_article_streaming(sys.argv[1]): - if article_id != last_article_id: - last_article_id = article_id - last_text = "" - result = differ.inline_json_diff(last_text, text) - print(result, file=of) + for _, texts in stream_text_by_article_streaming(sys.argv[1]): + last_text = "" + for text in texts: + result = differ.inline_json_diff(last_text, text) + print(result, file=of) + last_text = text