예제 #1
0
    def test_parse_escaped_strings(self):
        text = r'''
string a = "Hello \"world\""
string b = "Hello \"world\"\\"
int c = 8;
'''
        file_parser = FileParser()
        result, _ = file_parser._parse_strings_comments(text)
        self.assertEqual(r'"Hello \"world\""', result[0].content)
        self.assertEqual(r'"Hello \"world\"\\"', result[1].content)
예제 #2
0
    def test_parse_escaped_strings(self):
        text = r'''
string a = "Hello \"world\""
string b = "Hello \"world\"\\"
int c = 8;
'''
        file_parser = FileParser()
        result, _ = file_parser._parse_strings_comments(text)
        self.assertEqual(r'"Hello \"world\""', result[0].content)
        self.assertEqual(r'"Hello \"world\"\\"', result[1].content)
예제 #3
0
 def test_parse_escaped_strings2(self):
     text = r'''cout << "   \"" << (char *)testSet[i].input << '\"';'''
     file_parser = FileParser()
     result, _ = file_parser._parse_strings_comments(text)
     self.assertEqual(r'"   \""', result[0].content)
     self.assertEqual(r"'\"'", result[1].content)
예제 #4
0
 def test_parse_escaped_strings2(self):
     text = r'''cout << "   \"" << (char *)testSet[i].input << '\"';'''
     file_parser = FileParser()
     result, _ = file_parser._parse_strings_comments(text)
     self.assertEqual(r'"   \""', result[0].content)
     self.assertEqual(r"'\"'", result[1].content)