# Path: pycket/test/testhelper.py
# def execute(p, stdlib=False, extra=""):
#     return run_mod_expr(p, stdlib=stdlib, extra=extra)
# 
# def run_fix(p, v=None, stdlib=False, extra="", equal_huh=False):
#     new = pytest.config.new_pycket
#     if new:
#         return run_expr(p, v, equal_huh=equal_huh)
#     ov = run_mod_expr(p,stdlib=stdlib, extra=extra)
#     assert isinstance(ov, values.W_Fixnum)
#     if v is not None:
#         assert ov.value == v
#     return ov.value
# 
# def run(p, v=None, stdlib=False, extra="", expect_to_fail=False):
#     if pytest.config.new_pycket:
#         return run_expr_result(p, expect_to_fail=expect_to_fail, v=v)
#     return run_mod_expr(p,v=v,stdlib=stdlib, extra=extra)


from pycket.values import *
from pycket.test.testhelper import execute, run_fix, run
#! /usr/bin/env python
# -*- coding: utf-8 -*-




class TestConses(object):

    def test_basics(self):
        _1, _2, _3 = W_Fixnum(1), W_Fixnum(2), W_Fixnum(3)
        c =  W_Cons.make(_1, _2)
        assert c.car().value == _1.value
        assert c.cdr().value == _2.value
        l = to_list([_1, _2, _3])
        assert l.car().value == _1.value
        assert l.cdr().car().value == _2.value
        assert l.cdr().cdr().car().value == _3.value
        assert l.cdr().cdr().cdr() == w_null


    def test_basic_hl(self):
        run_fix("(car (cons 1 2))", 1)
        run_fix("(cdr (cons 1 2))", 2)
        run_fix("(car (list 1))", 1)
        run_fix("(car (cdr (list 1 2)))", 2)
        run("(equal? (cons 1 2) (cons 1 2))", w_true)
        run("(equal? (cons 1 2) (cons 2 2))", w_false)

# Path: pycket/test/testhelper.py
# def execute(p, stdlib=False, extra=""):
#     return run_mod_expr(p, stdlib=stdlib, extra=extra)
# 
# def run_fix(p, v=None, stdlib=False, extra="", equal_huh=False):
#     new = pytest.config.new_pycket
#     if new:
#         return run_expr(p, v, equal_huh=equal_huh)
#     ov = run_mod_expr(p,stdlib=stdlib, extra=extra)
#     assert isinstance(ov, values.W_Fixnum)
#     if v is not None:
#         assert ov.value == v
#     return ov.value
# 
# def run(p, v=None, stdlib=False, extra="", expect_to_fail=False):
#     if pytest.config.new_pycket:
#         return run_expr_result(p, expect_to_fail=expect_to_fail, v=v)
#     return run_mod_expr(p,v=v,stdlib=stdlib, extra=extra)


# Path: pycket/test/test_conses.py
from pycket.values import *
from pycket.test.testhelper import execute, run_fix, run

#! /usr/bin/env python
# -*- coding: utf-8 -*-




class TestConses(object):

    def test_basics(self):
        _1, _2, _3 = W_Fixnum(1), W_Fixnum(2), W_Fixnum(3)
        c =  W_Cons.make(_1, _2)
        assert c.car().value == _1.value
        assert c.cdr().value == _2.value
        l = to_list([_1, _2, _3])
        assert l.car().value == _1.value
        assert l.cdr().car().value == _2.value
        assert l.cdr().cdr().car().value == _3.value
        assert l.cdr().cdr().cdr() == w_null


    def test_basic_hl(self):
        run_fix("(car (cons 1 2))", 1)
        run_fix("(cdr (cons 1 2))", 2)
        run_fix("(car (list 1))", 1)
        run_fix("(car (cdr (list 1 2)))", 2)
        run("(equal? (cons 1 2) (cons 1 2))", w_true)
        run("(equal? (cons 1 2) (cons 2 2))", w_false)

        run("(equal? (cons 1 2) (quote barf))", w_false)