From e2b77a33dde686d385cee9bf0b4d037a4c1cedf4 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Wed, 18 Jun 2014 18:23:09 +0200 Subject: [PATCH] Fixed test_matchcompiler.py --- tools/test_matchcompiler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/test_matchcompiler.py b/tools/test_matchcompiler.py index 6f5e8008c..732d77f94 100755 --- a/tools/test_matchcompiler.py +++ b/tools/test_matchcompiler.py @@ -43,7 +43,7 @@ class MatchCompilerTest(unittest.TestCase): input = 'if (Token::Match(tok->next()->next(), "foobar %type% %num%")) {' output = self.mc._replaceTokenMatch(input) self.assertEqual(output, 'if (match2(tok->next()->next())) {') - self.assertEqual(2, len(self.mc._matchStrs)) + self.assertEqual(1, len(self.mc._matchStrs)) input = 'if (Token::Match(tok, "foo\"special\"bar %num%")) {' output = self.mc._replaceTokenMatch(input) @@ -81,7 +81,7 @@ class MatchCompilerTest(unittest.TestCase): input = 'if (Token::Match(tok, "foobar2 %varid%", 123) || Token::Match(tok, "%type% %varid%", 123)) {' output = self.mc._replaceTokenMatch(input) self.assertEqual(output, 'if (match3(tok, 123) || match4(tok, 123)) {') - self.assertEqual(3, len(self.mc._matchStrs)) + self.assertEqual(2, len(self.mc._matchStrs)) def test_replaceTokenSimpleMatch(self): input = 'if (Token::simpleMatch(tok, "foobar")) {' @@ -143,7 +143,7 @@ class MatchCompilerTest(unittest.TestCase): output = self.mc._replaceTokenFindMatch(input) self.assertEqual( output, 'if (findmatch3(tok->next()->next(), tok->link())) {') - self.assertEqual(2, len(self.mc._matchStrs)) + self.assertEqual(1, len(self.mc._matchStrs)) self.assertEqual(1, self.mc._matchStrs['foobar']) # findmatch with end token and varid @@ -151,7 +151,7 @@ class MatchCompilerTest(unittest.TestCase): output = self.mc._replaceTokenFindMatch(input) self.assertEqual( output, 'if (findmatch4(tok->next()->next(), tok->link(), 123)) {') - self.assertEqual(2, len(self.mc._matchStrs)) + self.assertEqual(1, len(self.mc._matchStrs)) self.assertEqual(1, self.mc._matchStrs['foobar']) if __name__ == '__main__':