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 {
149149 }
150150 }
151151
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+
152175 #[ test]
153176 fn double_newlines ( ) {
154177 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]) {
183183 SyntaxKind :: EXCEPT_KW ,
184184 // for grant
185185 SyntaxKind :: GRANT_KW ,
186+ // for revoke
187+ SyntaxKind :: REVOKE_KW ,
186188 SyntaxKind :: COMMA ,
187189 ]
188190 . iter ( )
@@ -215,6 +217,8 @@ pub(crate) fn unknown(p: &mut Splitter, exclude: &[SyntaxKind]) {
215217 SyntaxKind :: INSTEAD_KW ,
216218 // for grant
217219 SyntaxKind :: GRANT_KW ,
220+ // for revoke
221+ SyntaxKind :: REVOKE_KW ,
218222 SyntaxKind :: COMMA ,
219223 // Do update in INSERT stmt
220224 SyntaxKind :: DO_KW ,
You can’t perform that action at this time.
0 commit comments