File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed
tests/data/statements/valid Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -559,6 +559,12 @@ fn custom_handlers(node: &Node) -> TokenStream {
559559 tokens. push( TokenProperty :: from( Token :: Authorization ) ) ;
560560 }
561561 } ,
562+ "CreateEnumStmt" => quote ! {
563+ tokens. push( TokenProperty :: from( Token :: Create ) ) ;
564+ tokens. push( TokenProperty :: from( Token :: TypeP ) ) ;
565+ tokens. push( TokenProperty :: from( Token :: As ) ) ;
566+ tokens. push( TokenProperty :: from( Token :: EnumP ) ) ;
567+ } ,
562568 _ => quote ! { } ,
563569 }
564570}
Original file line number Diff line number Diff line change @@ -66,10 +66,7 @@ mod tests {
6666
6767 debug ! ( "selected node: {:#?}" , node_graph[ node_index] ) ;
6868
69- assert ! ( node_graph[ node_index]
70- . properties
71- . iter( )
72- . all( |p| { expected. contains( p) } ) ) ;
69+ assert_eq ! ( node_graph[ node_index] . properties, expected) ;
7370 assert_eq ! ( node_graph[ node_index] . properties. len( ) , expected. len( ) ) ;
7471 }
7572
@@ -140,4 +137,21 @@ mod tests {
140137 ] ,
141138 )
142139 }
140+
141+ #[ test]
142+ fn test_create_enum ( ) {
143+ test_get_node_properties (
144+ "create type status as enum ('open', 'closed');" ,
145+ SyntaxKind :: CreateEnumStmt ,
146+ vec ! [
147+ TokenProperty :: from( SyntaxKind :: Create ) ,
148+ TokenProperty :: from( SyntaxKind :: TypeP ) ,
149+ TokenProperty :: from( SyntaxKind :: As ) ,
150+ TokenProperty :: from( SyntaxKind :: EnumP ) ,
151+ TokenProperty :: from( "status" . to_string( ) ) ,
152+ TokenProperty :: from( "open" . to_string( ) ) ,
153+ TokenProperty :: from( "closed" . to_string( ) ) ,
154+ ] ,
155+ )
156+ }
143157}
Original file line number Diff line number Diff line change 1+ CREATE TYPE bug_status AS ENUM (' new' , ' open' , ' closed' );
You can’t perform that action at this time.
0 commit comments