summaryrefslogtreecommitdiff
path: root/Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py')
-rwxr-xr-xQwen2.5-Eval/evaluation/latex2sympy/tests/abs_test.py19
1 files changed, 19 insertions, 0 deletions
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)