@@ -2882,6 +2882,48 @@ select '{[1.234, 5.678]}'::floatmultirangerange$0;
28822882 " ) ;
28832883 }
28842884
2885+ #[ test]
2886+ fn goto_cast_boolean_falls_back_to_bool ( ) {
2887+ assert_snapshot ! ( goto( "
2888+ create type pg_catalog.bool;
2889+ select '1'::boolean$0;
2890+ " ) , @"
2891+ ββΈ
2892+ 2 β create type pg_catalog.bool;
2893+ β ββββ 2. destination
2894+ 3 β select '1'::boolean;
2895+ β°β΄ β 1. source
2896+ " ) ;
2897+ }
2898+
2899+ #[ test]
2900+ fn goto_cast_decimal_falls_back_to_numeric ( ) {
2901+ assert_snapshot ! ( goto( "
2902+ create type pg_catalog.numeric;
2903+ select 1::decimal$0(10, 2);
2904+ " ) , @"
2905+ ββΈ
2906+ 2 β create type pg_catalog.numeric;
2907+ β βββββββ 2. destination
2908+ 3 β select 1::decimal(10, 2);
2909+ β°β΄ β 1. source
2910+ " ) ;
2911+ }
2912+
2913+ #[ test]
2914+ fn goto_cast_float_falls_back_to_float8 ( ) {
2915+ assert_snapshot ! ( goto( "
2916+ create type pg_catalog.float8;
2917+ select 1::float$0;
2918+ " ) , @"
2919+ ββΈ
2920+ 2 β create type pg_catalog.float8;
2921+ β ββββββ 2. destination
2922+ 3 β select 1::float;
2923+ β°β΄ β 1. source
2924+ " ) ;
2925+ }
2926+
28852927 #[ test]
28862928 fn goto_cast_bigint_falls_back_to_int8 ( ) {
28872929 assert_snapshot ! ( goto( "
@@ -2896,6 +2938,20 @@ select 1::bigint$0;
28962938 " ) ;
28972939 }
28982940
2941+ #[ test]
2942+ fn goto_cast_real_falls_back_to_float4 ( ) {
2943+ assert_snapshot ! ( goto( "
2944+ create type pg_catalog.float4;
2945+ select 1::real$0;
2946+ " ) , @"
2947+ ββΈ
2948+ 2 β create type pg_catalog.float4;
2949+ β ββββββ 2. destination
2950+ 3 β select 1::real;
2951+ β°β΄ β 1. source
2952+ " ) ;
2953+ }
2954+
28992955 #[ test]
29002956 fn goto_cast_bigint_prefers_user_type ( ) {
29012957 assert_snapshot ! ( goto( "
0 commit comments