11import { assertType , type IsExact } from "@std/testing/types" ;
2- import type { Detail , UnitDetail } from "./item.ts" ;
2+ import type { Detail , DetailUnit } from "./item.ts" ;
33
44Deno . test ( "Detail" , async ( t ) => {
55 await t . step ( "is usable as a type constraint" , ( ) => {
@@ -30,9 +30,9 @@ Deno.test("Detail", async (t) => {
3030 } ) ;
3131} ) ;
3232
33- Deno . test ( "UnitDetail " , async ( t ) => {
33+ Deno . test ( "DetailUnit " , async ( t ) => {
3434 await t . step ( "is NOT usable as a type constraint" , ( ) => {
35- function constraint < T extends UnitDetail > ( _ : T ) { }
35+ function constraint < T extends DetailUnit > ( _ : T ) { }
3636 constraint ( { } ) ;
3737 constraint ( { a : "" } ) ;
3838 constraint ( { a : "" , b : "" } ) ;
@@ -51,10 +51,10 @@ Deno.test("UnitDetail", async (t) => {
5151 } ) ;
5252
5353 await t . step ( "is an unit of Detail" , ( ) => {
54- assertType < IsExact < UnitDetail & { a : string } , { a : string } > > ( true ) ;
54+ assertType < IsExact < DetailUnit & { a : string } , { a : string } > > ( true ) ;
5555 // misc
56- assertType < IsExact < UnitDetail , UnitDetail > > ( true ) ;
57- assertType < IsExact < UnitDetail & UnitDetail , UnitDetail > > ( true ) ;
58- assertType < IsExact < UnitDetail & Detail , Detail > > ( true ) ;
56+ assertType < IsExact < DetailUnit , DetailUnit > > ( true ) ;
57+ assertType < IsExact < DetailUnit & DetailUnit , DetailUnit > > ( true ) ;
58+ assertType < IsExact < DetailUnit & Detail , Detail > > ( true ) ;
5959 } ) ;
6060} ) ;
0 commit comments