From 1d59ba9f01d29fe2c9f0591a09c9def682a4a614 Mon Sep 17 00:00:00 2001 From: mbkma Date: Thu, 14 Aug 2025 17:22:01 +0200 Subject: =?UTF-8?q?fix=20Expressions=20like=20e=C2=B23=20crashes=20mate-ca?= =?UTF-8?q?lc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test-mp-equation.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test-mp-equation.c') diff --git a/src/test-mp-equation.c b/src/test-mp-equation.c index 5d480df..1ccab9c 100644 --- a/src/test-mp-equation.c +++ b/src/test-mp-equation.c @@ -771,6 +771,14 @@ test_equations(void) //options.wordlen = 2; //test("¬01₂", "10₂", 0); //test("¬¬10₂", "10₂", 0); + + /* Regression tests for crash bug with variable names + superscript + number */ + /* These should return error instead of crashing (issue: e²3 should be invalid) */ + test("e²3", "", PARSER_ERR_INVALID); + test("var²3", "", PARSER_ERR_UNKNOWN_VARIABLE); + test("x¹²3", "", PARSER_ERR_INVALID); + test("abc¹²³456", "", PARSER_ERR_UNKNOWN_VARIABLE); + test("test²²²1", "", PARSER_ERR_UNKNOWN_VARIABLE); } int -- cgit v1.2.1