import unittest
from util import eval_code

class test_opcodes_compare(unittest.TestCase):
    def test_compare(self):
        self.failUnless(eval_code("2 < 1","False\n",title='test_opcodes_compare: 1'))
        self.failUnless(eval_code("2 <= 1","False\n",title='test_opcodes_compare: 2'))
        self.failUnless(eval_code("2 == 1","False\n",title='test_opcodes_compare: 3'))
        self.failUnless(eval_code("2 != 1","True\n",title='test_opcodes_compare: 4'))
        self.failUnless(eval_code("2 > 1","True\n",title='test_opcodes_compare: 5'))
        self.failUnless(eval_code("2 >= 1","True\n",title='test_opcodes_compare: 6'))
        #self.failUnless(eval_code("2 in (1,2,3)","True\n"))
        #self.failUnless(eval_code("2 not in (1,2,3)","False\n"))
        self.failUnless(eval_code("2 is 1","False\n",title='test_opcodes_compare: 9'))
        self.failUnless(eval_code("2 is not 1","True\n",title='test_opcodes_compare: 10'))
        # exception match?
        #BAD ?
        
if __name__ == "__main__":
    unittest.main()


