From fc6d57ffb8d5ddb5820fcc00b5491a585c259ebc Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Thu, 4 Sep 2025 22:16:22 -0500 Subject: Initial commit --- Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py') diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py b/Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py new file mode 100755 index 0000000..37d130c --- /dev/null +++ b/Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py @@ -0,0 +1,19 @@ +from .context import assert_equal, get_simple_examples +import pytest +from sympy import Abs + +examples = get_simple_examples(Abs) + +delimiter_pairs = { + '|': '|', + '\\vert': '\\vert', + '\\lvert': '\\rvert' +} + + +@pytest.mark.parametrize('input, output, symbolically', examples) +def test_abs(input, output, symbolically): + for left, right in delimiter_pairs.items(): + assert_equal("{left}{input}{right}".format(left=left, right=right, input=input), output, symbolically=symbolically) + assert_equal("\\left{left}{input}\\right{right}".format(left=left, right=right, input=input), output, symbolically=symbolically) + assert_equal("\\mleft{left}{input}\\mright{right}".format(left=left, right=right, input=input), output, symbolically=symbolically) -- cgit v1.2.3