diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/test_exceptions_alias.c | 15 | ||||
-rw-r--r-- | tests/core/test_exceptions_alias.out | 2 | ||||
-rw-r--r-- | tests/test_core.py | 6 |
3 files changed, 23 insertions, 0 deletions
diff --git a/tests/core/test_exceptions_alias.c b/tests/core/test_exceptions_alias.c new file mode 100644 index 00000000..0c8cc37a --- /dev/null +++ b/tests/core/test_exceptions_alias.c @@ -0,0 +1,15 @@ +#define _POSIX_SOURCE +#include <locale.h> +#include <ctype.h> +#include <stdio.h> + +int main(void) { + try { + printf("*%i*\n", isdigit('0')); + printf("*%i*\n", isdigit_l('0', LC_GLOBAL_LOCALE)); + } + catch (...) { + printf("EXCEPTION!\n"); + } +} + diff --git a/tests/core/test_exceptions_alias.out b/tests/core/test_exceptions_alias.out new file mode 100644 index 00000000..2f67e501 --- /dev/null +++ b/tests/core/test_exceptions_alias.out @@ -0,0 +1,2 @@ +*1* +*1* diff --git a/tests/test_core.py b/tests/test_core.py index 3d1c90a3..ad35178c 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1366,6 +1366,12 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) + def test_exceptions_alias(self): + Settings.DISABLE_EXCEPTION_CATCHING = 0 + test_path = path_from_root('tests', 'core', 'test_exceptions_alias') + src, output = (test_path + s for s in ('.c', '.out')) + self.do_run_from_file(src, output) + def test_async_exit(self): open('main.c', 'w').write(r''' #include <stdio.h> |