@@ -31,6 +31,10 @@ def special(values, feature, parent):
3131 def sqrt (values , feature , parent ):
3232 pass
3333
34+ @qgsfunction (1 , 'testing' , register = False , usesgeometry = True )
35+ def geomtest (values , feature , parent ):
36+ pass
37+
3438 def tearDown (self ):
3539 QgsExpression .unregisterFunction ('testfun' )
3640
@@ -79,6 +83,10 @@ def testCantOverrideBuiltinsWithRegister(self):
7983 success = QgsExpression .registerFunction (self .sqrt )
8084 self .assertFalse (success )
8185
86+ def testCanRegisterGeometryFunction (self ):
87+ success = QgsExpression .registerFunction (self .geomtest )
88+ self .assertTrue (success )
89+
8290 def testCantOverrideBuiltinsWithUnregister (self ):
8391 success = QgsExpression .unregisterFunction ("sqrt" )
8492 self .assertFalse (success )
@@ -98,7 +106,7 @@ def testBlockComment(self):
98106 expressions = {
99107 "'test' /* comment */" : 'test' ,
100108 "/* comment */'test'" : 'test' ,
101- "/* comment */'test*/'" : 'test*/' ,
109+ "/* comment */'test*/'" : 'test*/' ,
102110 "/** comment */'test*/'" : 'test*/' ,
103111 "/* comment **/'test*/' /* comment */" : 'test*/' ,
104112 "'test/*'/* comment */" : 'test/*' ,
0 commit comments