@@ -2505,5 +2505,96 @@ defmodule Module.Types.DescrTest do
25052505 refute subtype? ( map1 , map2 )
25062506 assert subtype? ( map2 , map1 )
25072507 end
2508+
2509+ test "struct difference" do
2510+ entries =
2511+ [
2512+ closed_map ( __struct__: atom ( [ MapSet ] ) , map: term ( ) ) ,
2513+ closed_map ( __struct__: atom ( [ Jason.OrderedObject ] ) , values: term ( ) ) ,
2514+ closed_map ( __struct__: atom ( [ GenEvent.Stream ] ) , timeout: term ( ) , manager: term ( ) ) ,
2515+ closed_map ( __struct__: atom ( [ HashDict ] ) , size: term ( ) , root: term ( ) ) ,
2516+ closed_map ( __struct__: atom ( [ HashSet ] ) , size: term ( ) , root: term ( ) ) ,
2517+ closed_map (
2518+ __struct__: atom ( [ IO.Stream ] ) ,
2519+ raw: term ( ) ,
2520+ device: term ( ) ,
2521+ line_or_bytes: term ( )
2522+ ) ,
2523+ closed_map ( __struct__: atom ( [ Range ] ) , first: term ( ) , last: term ( ) , step: term ( ) ) ,
2524+ closed_map (
2525+ __struct__: atom ( [ Stream ] ) ,
2526+ enum: term ( ) ,
2527+ done: term ( ) ,
2528+ funs: term ( ) ,
2529+ accs: term ( )
2530+ ) ,
2531+ closed_map (
2532+ __struct__: atom ( [ Req.Response.Async ] ) ,
2533+ pid: term ( ) ,
2534+ ref: term ( ) ,
2535+ stream_fun: term ( ) ,
2536+ cancel_fun: term ( )
2537+ ) ,
2538+ closed_map (
2539+ __struct__: atom ( [ Postgrex.Stream ] ) ,
2540+ options: term ( ) ,
2541+ params: term ( ) ,
2542+ query: term ( ) ,
2543+ conn: term ( )
2544+ ) ,
2545+ closed_map (
2546+ __struct__: atom ( [ DBConnection.PrepareStream ] ) ,
2547+ opts: term ( ) ,
2548+ params: term ( ) ,
2549+ query: term ( ) ,
2550+ conn: term ( )
2551+ ) ,
2552+ closed_map (
2553+ __struct__: atom ( [ DBConnection.Stream ] ) ,
2554+ opts: term ( ) ,
2555+ params: term ( ) ,
2556+ query: term ( ) ,
2557+ conn: term ( )
2558+ ) ,
2559+ closed_map (
2560+ __struct__: atom ( [ Ecto.Adapters.SQL.Stream ] ) ,
2561+ meta: term ( ) ,
2562+ opts: term ( ) ,
2563+ params: term ( ) ,
2564+ statement: term ( )
2565+ ) ,
2566+ closed_map (
2567+ __struct__: atom ( [ Date.Range ] ) ,
2568+ first: term ( ) ,
2569+ last: term ( ) ,
2570+ step: term ( ) ,
2571+ first_in_iso_days: term ( ) ,
2572+ last_in_iso_days: term ( )
2573+ ) ,
2574+ closed_map (
2575+ __struct__: atom ( [ File.Stream ] ) ,
2576+ node: term ( ) ,
2577+ raw: term ( ) ,
2578+ path: term ( ) ,
2579+ modes: term ( ) ,
2580+ line_or_bytes: term ( )
2581+ ) ,
2582+ closed_map (
2583+ __struct__: atom ( [ Phoenix.LiveView.LiveStream ] ) ,
2584+ name: term ( ) ,
2585+ ref: term ( ) ,
2586+ inserts: term ( ) ,
2587+ deletes: term ( ) ,
2588+ reset?: term ( ) ,
2589+ dom_id: term ( ) ,
2590+ consumable?: term ( )
2591+ )
2592+ ]
2593+
2594+ range =
2595+ closed_map ( __struct__: atom ( [ Range ] ) , first: integer ( ) , last: integer ( ) , step: integer ( ) )
2596+
2597+ assert subtype? ( range , Enum . reduce ( entries , & union / 2 ) )
2598+ end
25082599 end
25092600end
0 commit comments