diff options
author | mbkma <[email protected]> | 2025-08-14 17:22:01 +0200 |
---|---|---|
committer | mbkma <[email protected]> | 2025-08-14 17:23:03 +0200 |
commit | 1d59ba9f01d29fe2c9f0591a09c9def682a4a614 (patch) | |
tree | 6b66982688e9cabfaa587e03de3e8b652072d8a3 /src/test-mp-equation.c | |
parent | 7ef327f6f269c7a49357e001cd41d7aaf5807749 (diff) | |
download | mate-calc-fix/#213.tar.bz2 mate-calc-fix/#213.tar.xz |
fix Expressions like e²3 crashes mate-calcfix/#213
Diffstat (limited to 'src/test-mp-equation.c')
-rw-r--r-- | src/test-mp-equation.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 |