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 );