From 2e9550ff037075ec8d86bb4c6cb81f719696bdc4 Mon Sep 17 00:00:00 2001 From: KangWon Lee Date: Tue, 26 Dec 2017 10:51:38 +0900 Subject: [PATCH] added test cases for Symbol() --- test_symbol_converter.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test_symbol_converter.py b/test_symbol_converter.py index b558abd7..9173248e 100644 --- a/test_symbol_converter.py +++ b/test_symbol_converter.py @@ -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()