Esempio n. 1
0
 def test_desugar_expression_let_failure_3(self):
     a = ['let', [[object(), 'c']], 'b']
     try:
         macro_system.desugar_expression(a)
     except VentureException as e:
         self.assertEqual(e.data['expression_index'], [1, 0, 0])
     else:
         self.fail()
Esempio n. 2
0
 def test_desugar_expression_let_failure_1(self):
     a = ['let', 'a', 'b']
     try:
         macro_system.desugar_expression(a)
     except VentureException as e:
         self.assertEqual(e.data['expression_index'], [1])
     else:
         self.fail()
Esempio n. 3
0
 def test_desugar_expression_let_3(self):
     a = ['let', [['a', 'b'], ['c', 'd']], 'e']
     b = [[
         'make_csp', ['quote', ['a']],
         ['quote', [['make_csp', ['quote', ['c']], ['quote', 'e']], 'd']]
     ], 'b']
     self.assertEqual(macro_system.desugar_expression(a), b)
Esempio n. 4
0
 def test_desugar_expression_nested(self):
     a = [['and', 'a', 'b']]
     b = [[[
         'biplex', 'a', ['make_csp', ['quote', []], ['quote', 'b']],
         ['make_csp', ['quote', []], ['quote', v.boolean(False)]]
     ]]]
     self.assertEqual(macro_system.desugar_expression(a), b)
Esempio n. 5
0
 def test_desugar_nothing(self):
     a = ['b']
     b = ['b']
     self.assertEqual(macro_system.desugar_expression(a), b)
Esempio n. 6
0
 def test_desugar_expression_identity(self):
     a = ['identity', 'b']
     b = 'b'
     self.assertEqual(macro_system.desugar_expression(a), b)
Esempio n. 7
0
 def test_desugar_expression_let_1(self):
     a = ['let', [], 'b']
     b = 'b'
     self.assertEqual(macro_system.desugar_expression(a), b)