@@ -31,6 +31,10 @@ def special(values, feature, parent):
31
31
def sqrt (values , feature , parent ):
32
32
pass
33
33
34
+ @qgsfunction (1 , 'testing' , register = False , usesgeometry = True )
35
+ def geomtest (values , feature , parent ):
36
+ pass
37
+
34
38
def tearDown (self ):
35
39
QgsExpression .unregisterFunction ('testfun' )
36
40
@@ -79,6 +83,10 @@ def testCantOverrideBuiltinsWithRegister(self):
79
83
success = QgsExpression .registerFunction (self .sqrt )
80
84
self .assertFalse (success )
81
85
86
+ def testCanRegisterGeometryFunction (self ):
87
+ success = QgsExpression .registerFunction (self .geomtest )
88
+ self .assertTrue (success )
89
+
82
90
def testCantOverrideBuiltinsWithUnregister (self ):
83
91
success = QgsExpression .unregisterFunction ("sqrt" )
84
92
self .assertFalse (success )
@@ -98,7 +106,7 @@ def testBlockComment(self):
98
106
expressions = {
99
107
"'test' /* comment */" : 'test' ,
100
108
"/* comment */'test'" : 'test' ,
101
- "/* comment */'test*/'" : 'test*/' ,
109
+ "/* comment */'test*/'" : 'test*/' ,
102
110
"/** comment */'test*/'" : 'test*/' ,
103
111
"/* comment **/'test*/' /* comment */" : 'test*/' ,
104
112
"'test/*'/* comment */" : 'test/*' ,
0 commit comments