From bdd1582bd96b0f7cfe4b39ed4e8d75c3aed362ad Mon Sep 17 00:00:00 2001 From: jmnote Date: Mon, 2 Nov 2026 00:47:28 +0900 Subject: [PATCH] Bump version to 1.2.1 --- Makefile | 1 + extension.json | 2 +- tests/MacrosTest.php | 52 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tests/MacrosTest.php diff --git a/Makefile b/Makefile index ba101d56..c174ec26 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ test: ## Run the pure-PHP test suites php tests/RevisionOverridesTest.php php tests/IgnoreHtmlClassTest.php php tests/JsDefaultsTest.php + php tests/MacrosTest.php phpcs: vendor/autoload.php ## parallel-lint + minus-x + phpcs against the MediaWiki coding standard composer test diff --git a/extension.json b/extension.json index 77734fc4..9eced455 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "SimpleMathJax", - "version": "1.2.0", + "version": "1.2.1", "author": "jmnote", "url": "https://www.mediawiki.org/wiki/Extension:SimpleMathJax", "description": "render TeX between and ", diff --git a/tests/MacrosTest.php b/tests/MacrosTest.php new file mode 100644 index 00000000..60dd2284 --- /dev/null +++ b/tests/MacrosTest.php @@ -0,0 +1,52 @@ + 0 ); + +// Verify PR #87 fixes +assert_same( 'Bbb macro does not wrap in outer group', '"\\\\mathbb"', $macros['Bbb'] ?? null ); +assert_same( 'bold macro does not wrap in outer group', '"\\\\mathbf"', $macros['bold'] ?? null ); +assert_same( 'vline macro has valid smash lvert syntax', '"{\\\\smash{\\\\large\\\\lvert}}"', $macros['vline'] ?? null ); + +// All macros have balanced braces +$unbalanced = []; +foreach ( $macros as $name => $def ) { + if ( substr_count( $def, '{' ) !== substr_count( $def, '}' ) ) { + $unbalanced[] = "$name: $def"; + } +} +assert_same( 'all macros have balanced braces', [], $unbalanced ); + +echo $failures === 0 ? "\nAll tests passed.\n" : "\n$failures test(s) FAILED.\n"; +exit( $failures === 0 ? 0 : 1 );