Skip to content
Permalink
Browse files

Add block comment tests

  • Loading branch information
m-kuhn committed Nov 26, 2014
1 parent 0a7facb commit 13255b13ae50ed4b58f01dfbcaeb8eafb39d8334
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/src/python/test_qgsexpression.py
@@ -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.
You can’t perform that action at this time.