Skip to content

Commit

Permalink
test for parser within parser
Browse files Browse the repository at this point in the history
  • Loading branch information
leonelcamara committed Aug 13, 2021
1 parent 4769817 commit 824715e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest
from hotxlfp import Parser



class TestParser(unittest.TestCase):

def test_parser_within_parser(self):

def parse(formula):
parser = Parser(debug=True)
result = parser.parse(formula)
return result['result']

parser = Parser(debug=True)
parser.set_function('EVAL', parse)
first_result = parser.parse('EVAL("1+1")')['result']
second_result = parser.parse('EVAL("1+1")')['result']
self.assertEqual(first_result, second_result)

0 comments on commit 824715e

Please sign in to comment.