
import pytest

from eche.reader import read_str
from eche.eval import eval_ast, repl_env


@pytest.mark.parametrize("test_input,expected_value", [
    ('(+ 1 2)', 3),
    ('(- 5 9)', -4),
    ('(* 50 60)', 3_000),
    ('(/ 2 2)', 1),
    ('(+ 1 (* 3 5))', 16),
    ('(^ 2 2)', 4),
    ('(^ 2 3)', 8),
    ('(% 8 5)', 3),
    ('(% (^ 2 3) 5)', 3),
    ('(+ 2 3)', 5),
    ('(+ 2 (* 3 4))', 14),
])
def test_eval_add(test_input, expected_value):
    ast = read_str(test_input)
    assert eval_ast(ast, repl_env) == expected_value

@@ -172,21 +172,473 @@
  ('(
-- 5 9)', -4),
++ 2 3)', 5),%0A    ('(+ 2 (* 3 4))', 14),%0A%5D)%0Adef test_eval_add(test_input, expected_value):%0A    ast = read_str(test_input)%0A    assert eval_ast(ast, repl_env) == expected_value%0A%0A%0A@pytest.mark.parametrize(%22test_input,expected_value%22, %5B%0A    ('(- 5 9)', -4),%0A     ('(- 1 0)', 1),%0A%5D)%0Adef test_eval_sub(test_input, expected_value):%0A    ast = read_str(test_input)%0A    assert eval_ast(ast, repl_env) == expected_value%0A%0A%0A@pytest.mark.parametrize(%22test_input,expected_value%22, %5B
 %0A   
@@ -671,18 +671,18 @@
  ('(
-/ 2 2
+* 2 3
 )', 
-1
+8
 ),%0A 
@@ -693,42 +693,234 @@
 '(+ 
-1
+2
  (* 3 
-5
+4
 ))', 1
-6
+4
 ),%0A
+%5D)%0Adef test_eval_mul(test_input, expected_value):%0A    ast = read_str(test_input)%0A    assert eval_ast(ast, repl_env) == expected_value%0A%0A%0A@pytest.mark.parametrize(%22test_input,expected_value%22, %5B%0A
     ('(
-%5E
+/
  2 2)', 
 4),%0A
@@ -915,20 +915,212 @@
  2 2)', 
-4
+1
 ),%0A
+%5D)%0Adef test_eval_div(test_input, expected_value):%0A    ast = read_str(test_input)%0A    assert eval_ast(ast, repl_env) == expected_value%0A%0A%0A@pytest.mark.parametrize(%22test_input,expected_value%22, %5B%0A
     ('(%5E
@@ -1120,24 +1120,26 @@
    ('(%5E 
-2 3
+1 2
 )', 
-8
+0.5
 ),%0A    (
@@ -1144,54 +1144,245 @@
  ('(
-%25 8 5)', 3),%0A    ('(%25 (%5E 2 3) 5)', 3),
+%5E 3 4)', 0.75),%0A    ('(%5E 3 4)', 0.75),%0A%5D)%0Adef test_eval_exp(test_input, expected_value):%0A    ast = read_str(test_input)%0A    assert eval_ast(ast, repl_env) == expected_value%0A%0A@pytest.mark.parametrize(%22test_input,expected_value%22, %5B
 %0A    ('(
 + 2 
@@ -1373,34 +1373,34 @@
 %22, %5B%0A    ('(
-+ 2 3
+%25 8 5
 )', 
-5
+3
 ),%0A    ('(+ 
@@ -1397,33 +1397,32 @@
 %0A    ('(
-+ 2 (* 3 4)
+%25 (%5E 2 3) 5
 )', 
-14
+3
 ),%0A%5D)%0Ade
@@ -1425,35 +1425,35 @@
 )%0Adef test_eval_
-add
+exp
 (test_input, exp

Split tests into add, sub, mul, div and exp.