summaryrefslogtreecommitdiff
path: root/Qwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py
diff options
context:
space:
mode:
authorzitian-gao <zitian.gao@outlook.com>2025-05-27 16:45:31 +0800
committerzitian-gao <zitian.gao@outlook.com>2025-05-27 16:45:31 +0800
commit7c792461c8e4e4f1f8734fed143630c74e76b27f (patch)
treecf6341ff9f2727424751da7a11a3bea6c39015bb /Qwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py
parent16815c8c5ec263c4bd1a0af60030c1c0efa1421e (diff)
init eval
Diffstat (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py')
-rwxr-xr-xQwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py b/Qwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py
new file mode 100755
index 0000000..2fec010
--- /dev/null
+++ b/Qwen2.5-Eval/evaluation/latex2sympy/tests/binomial_test.py
@@ -0,0 +1,36 @@
+from .context import assert_equal, _Add, _Mul, _Pow
+import pytest
+from sympy import binomial, Symbol
+
+x = Symbol('x', real=True)
+y = Symbol('y', real=True)
+theta = Symbol('theta', real=True)
+gamma = Symbol('gamma', real=True)
+
+
+def test_binomial_numeric():
+ assert_equal("\\binom{16}{2}", binomial(16, 2))
+
+
+def test_binomial_symbols():
+ assert_equal("\\binom{x}{y}", binomial(x, y))
+
+
+def test_binomial_greek_symbols():
+ assert_equal("\\binom{\\theta}{\\gamma}", binomial(theta, gamma))
+
+
+def test_binomial_expr():
+ assert_equal("\\binom{16+2}{\\frac{4}{2}}", binomial(_Add(16, 2), _Mul(4, _Pow(2, -1)), evaluate=False))
+
+
+def test_choose_numeric():
+ assert_equal("\\choose{16}{2}", binomial(16, 2))
+
+
+def test_choose_symbols():
+ assert_equal("\\choose{x}{y}", binomial(x, y))
+
+
+def test_choose_greek_symbols():
+ assert_equal("\\choose{\\theta}{\\gamma}", binomial(theta, gamma))