Skip to content

Commit

Permalink
added test cases for Symbol()
Browse files Browse the repository at this point in the history
  • Loading branch information
kangwonlee committed Dec 26, 2017
1 parent 185d1d6 commit 2e9550f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test_symbol_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,28 @@ def test_find_symbol_name_location_01(self):

self.assertEqual(expected_extracted, extracted)

def test_find_symbol_name_location_10(self):
# 0 1 2
# 0123456789012345678901234567890123456789012345678901234567890123456789
# 0123456789012345678901234567890123456789012345678901234567890123456789
source_line = "L_AB_m = sy.Symbol('L_AB_m', real=True, nonnegative=True)"
result = self.cp.find_symbol_name_location(source_line)
extracted = source_line[result[0]:result[1]]
expected_extracted = 'L_AB_m'

self.assertEqual(expected_extracted, extracted)

def test_find_symbol_name_location_11(self):
# 0 1 2
# 0123456789012345678901234567890123456789012345678901234567890123456789
# 0123456789012345678901234567890123456789012345678901234567890123456789
source_line = "L_AB = sy.Symbol('L_AB_m', real=True, nonnegative=True)"
result = self.cp.find_symbol_name_location(source_line)
extracted = source_line[result[0]:result[1]]
expected_extracted = 'L_AB_m'

self.assertEqual(expected_extracted, extracted)


# def test_processor(self):
# file = self.file_processor.read_file()
Expand Down

0 comments on commit 2e9550f

Please sign in to comment.