File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
crates/pgt_statement_splitter/src Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,29 @@ mod tests {
149
149
}
150
150
}
151
151
152
+ #[ test]
153
+ fn revoke ( ) {
154
+ Tester :: from ( "revoke delete on table \" public\" .\" voice_call\" from \" anon\" ;" )
155
+ . expect_statements ( vec ! [
156
+ "revoke delete on table \" public\" .\" voice_call\" from \" anon\" ;" ,
157
+ ] ) ;
158
+
159
+ Tester :: from ( "revoke select on table \" public\" .\" voice_call\" from \" anon\" ;" )
160
+ . expect_statements ( vec ! [
161
+ "revoke select on table \" public\" .\" voice_call\" from \" anon\" ;" ,
162
+ ] ) ;
163
+
164
+ Tester :: from ( "revoke update on table \" public\" .\" voice_call\" from \" anon\" ;" )
165
+ . expect_statements ( vec ! [
166
+ "revoke update on table \" public\" .\" voice_call\" from \" anon\" ;" ,
167
+ ] ) ;
168
+
169
+ Tester :: from ( "revoke insert on table \" public\" .\" voice_call\" from \" anon\" ;" )
170
+ . expect_statements ( vec ! [
171
+ "revoke insert on table \" public\" .\" voice_call\" from \" anon\" ;" ,
172
+ ] ) ;
173
+ }
174
+
152
175
#[ test]
153
176
fn double_newlines ( ) {
154
177
Tester :: from ( "select 1 from contact\n \n select 1\n \n select 3" ) . expect_statements ( vec ! [
Original file line number Diff line number Diff line change @@ -183,6 +183,8 @@ pub(crate) fn unknown(p: &mut Splitter, exclude: &[SyntaxKind]) {
183
183
SyntaxKind :: EXCEPT_KW ,
184
184
// for grant
185
185
SyntaxKind :: GRANT_KW ,
186
+ // for revoke
187
+ SyntaxKind :: REVOKE_KW ,
186
188
SyntaxKind :: COMMA ,
187
189
]
188
190
. iter ( )
@@ -215,6 +217,8 @@ pub(crate) fn unknown(p: &mut Splitter, exclude: &[SyntaxKind]) {
215
217
SyntaxKind :: INSTEAD_KW ,
216
218
// for grant
217
219
SyntaxKind :: GRANT_KW ,
220
+ // for revoke
221
+ SyntaxKind :: REVOKE_KW ,
218
222
SyntaxKind :: COMMA ,
219
223
// Do update in INSERT stmt
220
224
SyntaxKind :: DO_KW ,
You can’t perform that action at this time.
0 commit comments