Skip to content

Commit

Permalink
Add block comment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 30, 2014
1 parent 0a7facb commit 13255b1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/src/python/test_qgsexpression.py
Expand Up @@ -87,5 +87,27 @@ def testDump(self):
for txt in ["id", u"idä", "\"id abc\"", "\"id abc\""]:
self.assertEqual( txt, QgsExpression(txt).expression() )

def testBlockComment(self):
expressions = {
"'test' /* comment */": 'test',
"/* comment */'test'": 'test',
"/* comment */'test*/'": 'test*/',
"/** comment */'test*/'": 'test*/',
"/* comment **/'test*/' /* comment */": 'test*/',
"'test/*'/* comment */": 'test/*',
"""/**
comment
**/
'test*/'""": 'test*/',
"""'test*/'
/**
comment
**/""": 'test*/'
}
for e, exp_res in expressions.iteritems():
exp = QgsExpression(e)
result = exp.evaluate()
self.assertEqual(exp_res, result)

if __name__ == "__main__":
unittest.main()

0 comments on commit 13255b1

Please sign in to comment.