File tree Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -59,30 +59,27 @@ fn test_get_deferred_sql_type() {
5959 }
6060
6161 // foreign keys to custom types
62- let type_path: syn:: TypePath = syn:: parse_quote!( butane:: ForeignType <Foo >) ;
62+ let type_path: syn:: TypePath = syn:: parse_quote!( butane:: ForeignKey <Foo >) ;
6363 let typ = syn:: Type :: Path ( type_path) ;
6464 let rv = get_deferred_sql_type ( & typ) ;
65- if let DeferredSqlType :: Deferred ( TypeKey :: CustomType ( typ) ) = rv {
66- assert_eq ! ( typ, "butane::ForeignType<Foo>" ) ;
67- } else {
68- panic ! ( )
69- }
65+ assert_eq ! (
66+ rv,
67+ DeferredSqlType :: Deferred ( TypeKey :: PK ( "Foo" . to_string( ) ) )
68+ ) ;
7069
71- let type_path: syn:: TypePath = syn:: parse_quote!( Option <butane:: ForeignType <Foo >>) ;
70+ let type_path: syn:: TypePath = syn:: parse_quote!( Option <butane:: ForeignKey <Foo >>) ;
7271 let typ = syn:: Type :: Path ( type_path) ;
7372 let rv = get_deferred_sql_type ( & typ) ;
74- if let DeferredSqlType :: Deferred ( TypeKey :: CustomType ( typ) ) = rv {
75- assert_eq ! ( typ, "butane::ForeignType<Foo>" ) ;
76- } else {
77- panic ! ( )
78- }
73+ assert_eq ! (
74+ rv,
75+ DeferredSqlType :: Deferred ( TypeKey :: PK ( "Foo" . to_string( ) ) )
76+ ) ;
7977
8078 let type_path: syn:: TypePath = syn:: parse_quote!( butane:: Many <Foo >) ;
8179 let typ = syn:: Type :: Path ( type_path) ;
8280 let rv = get_deferred_sql_type ( & typ) ;
83- if let DeferredSqlType :: Deferred ( TypeKey :: CustomType ( typ) ) = rv {
84- assert_eq ! ( typ, "butane::Many<Foo>" ) ;
85- } else {
86- panic ! ( )
87- }
81+ assert_eq ! (
82+ rv,
83+ DeferredSqlType :: Deferred ( TypeKey :: CustomType ( "butane::Many<Foo>" . into( ) ) )
84+ ) ;
8885}
You can’t perform that action at this time.
0 commit comments