Skip to content

Commit 13255b1

Browse files
committedNov 30, 2014
Add block comment tests
1 parent 0a7facb commit 13255b1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
 

‎tests/src/python/test_qgsexpression.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,27 @@ def testDump(self):
8787
for txt in ["id", u"idä", "\"id abc\"", "\"id abc\""]:
8888
self.assertEqual( txt, QgsExpression(txt).expression() )
8989

90+
def testBlockComment(self):
91+
expressions = {
92+
"'test' /* comment */": 'test',
93+
"/* comment */'test'": 'test',
94+
"/* comment */'test*/'": 'test*/',
95+
"/** comment */'test*/'": 'test*/',
96+
"/* comment **/'test*/' /* comment */": 'test*/',
97+
"'test/*'/* comment */": 'test/*',
98+
"""/**
99+
comment
100+
**/
101+
'test*/'""": 'test*/',
102+
"""'test*/'
103+
/**
104+
comment
105+
**/""": 'test*/'
106+
}
107+
for e, exp_res in expressions.iteritems():
108+
exp = QgsExpression(e)
109+
result = exp.evaluate()
110+
self.assertEqual(exp_res, result)
111+
90112
if __name__ == "__main__":
91113
unittest.main()

0 commit comments

Comments
 (0)
Please sign in to comment.