11import { expectTrimmedMatch } from "@wesl/mini-parse/vitest-util" ;
2- import { test } from "vitest" ;
32import { linkTest } from "./TestUtil.ts" ;
43
5- test ( "link global var" , async ( ) => {
4+ Deno . test ( "link global var" , async ( ) => {
65 const src = `var x: i32 = 1;` ;
76 const result = await linkTest ( src ) ;
87 expectTrimmedMatch ( result , src ) ;
98} ) ;
109
11- test ( "link an alias" , async ( ) => {
10+ Deno . test ( "link an alias" , async ( ) => {
1211 const src = `
1312 alias Num = f32;
1413
@@ -18,7 +17,7 @@ test("link an alias", async () => {
1817 expectTrimmedMatch ( result , src ) ;
1918} ) ;
2019
21- test ( "link a const_assert" , async ( ) => {
20+ Deno . test ( "link a const_assert" , async ( ) => {
2221 const src = `
2322 var x = 1;
2423 var y = 2;
@@ -28,7 +27,7 @@ test("link a const_assert", async () => {
2827 expectTrimmedMatch ( result , src ) ;
2928} ) ;
3029
31- test ( "link a struct" , async ( ) => {
30+ Deno . test ( "link a struct" , async ( ) => {
3231 const src = `
3332 struct Point {
3433 x: i32,
@@ -39,7 +38,7 @@ test("link a struct", async () => {
3938 expectTrimmedMatch ( result , src ) ;
4039} ) ;
4140
42- test ( "link a fn" , async ( ) => {
41+ Deno . test ( "link a fn" , async ( ) => {
4342 const src = `
4443 fn foo(x: i32, y: u32) -> f32 {
4544 return 1.0;
@@ -48,15 +47,15 @@ test("link a fn", async () => {
4847 expectTrimmedMatch ( result , src ) ;
4948} ) ;
5049
51- test ( "handle a ptr type" , async ( ) => {
50+ Deno . test ( "handle a ptr type" , async ( ) => {
5251 const src = `
5352 fn uint_bitfieldExtract_u1_i1_i1_(value: ptr<function, u32>, bits: ptr<function, i32>) -> u32 { }
5453 ` ;
5554 const result = await linkTest ( src ) ;
5655 expectTrimmedMatch ( result , src ) ;
5756} ) ;
5857
59- test ( "struct after var" , async ( ) => {
58+ Deno . test ( "struct after var" , async ( ) => {
6059 const src = `
6160 var config: TwoPassConfig;
6261
@@ -66,7 +65,7 @@ test("struct after var", async () => {
6665 expectTrimmedMatch ( result , src ) ;
6766} ) ;
6867
69- test ( "type inside fn with same name as fn" , async ( ) => {
68+ Deno . test ( "type inside fn with same name as fn" , async ( ) => {
7069 // illegal but shouldn't hang
7170 const src = `
7271 fn foo() {
@@ -78,7 +77,7 @@ test("type inside fn with same name as fn", async () => {
7877 expectTrimmedMatch ( result , src ) ;
7978} ) ;
8079
81- test ( "call cross reference" , async ( ) => {
80+ Deno . test ( "call cross reference" , async ( ) => {
8281 const src = `
8382 fn foo() {
8483 bar();
@@ -93,7 +92,7 @@ test("call cross reference", async () => {
9392 expectTrimmedMatch ( result , src ) ;
9493} ) ;
9594
96- test ( "struct self reference" , async ( ) => {
95+ Deno . test ( "struct self reference" , async ( ) => {
9796 const src = `
9897 struct A {
9998 a: A,
@@ -106,13 +105,13 @@ test("struct self reference", async () => {
106105 expectTrimmedMatch ( result , src ) ;
107106} ) ;
108107
109- test ( "parse texture_storage_2d with texture format in typical type position" , async ( ) => {
108+ Deno . test ( "parse texture_storage_2d with texture format in typical type position" , async ( ) => {
110109 const src = `var t: texture_storage_2d<rgba8unorm, write>;` ;
111110 const result = await linkTest ( src ) ;
112111 expectTrimmedMatch ( result , src ) ;
113112} ) ;
114113
115- test ( "struct member ref with extra component_or_swizzle" , async ( ) => {
114+ Deno . test ( "struct member ref with extra component_or_swizzle" , async ( ) => {
116115 const src = `
117116 struct C { p: P }
118117 struct P { x: u32 }
0 commit comments