Skip to content

Commit

Permalink
add messages to expects
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Nov 5, 2024
1 parent 90d9beb commit 519ea90
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/webgpu/api/operation/adapter/info.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,22 @@ but different objects from one another.`

const adapterInfo1 = adapter.info;
const adapterInfo2 = adapter.info;
t.expect(adapterInfo1 === adapterInfo2);
t.expect(adapterInfo1 === adapterInfo2, 'adapter.info should obey [SameObject]');

const device = await t.requestDeviceTracked(adapter);
assert(device !== null);

const deviceAdapterInfo1 = device.adapterInfo;
const deviceAdapterInfo2 = device.adapterInfo;
t.expect(deviceAdapterInfo1 === deviceAdapterInfo2);
t.expect(
deviceAdapterInfo1 === deviceAdapterInfo2,
'device.adapterInfo should obey [SameObject]'
);

t.expect(adapter.info !== device.adapterInfo);
t.expect(
adapter.info !== device.adapterInfo,
'adapter.info and device.adapterInfo should NOT return the same object'
);
});

g.test('device_matches_adapter')
Expand Down

0 comments on commit 519ea90

Please sign in to comment.