Skip to content

Commit d7f88a1

Browse files
authored
Add canvas texture direct attachment tests (#4584)
* Make Fixture.expect take a function for msg. * Test canvas texture can be used without createView Chrome and Firefox pass these tests. Safari 26.2 does not pass using a canvas as a color attachment or resolve target if you don't call createView
1 parent 319cd9b commit d7f88a1

4 files changed

Lines changed: 305 additions & 117 deletions

File tree

src/common/framework/fixture.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,18 +359,20 @@ export class Fixture<S extends SubcaseBatchState = SubcaseBatchState> {
359359
* t.expect(size >= maxSize); // prints Expect OK:
360360
* t.expect(() => size >= maxSize) // prints Expect OK: () => size >= maxSize
361361
*/
362-
expect(cond: boolean | (() => boolean), msg?: string): boolean {
362+
expect(cond: boolean | (() => boolean), msg?: string | (() => string)): boolean {
363363
if (typeof cond === 'function') {
364364
if (msg === undefined) {
365365
msg = cond.toString();
366366
}
367367
cond = cond();
368368
}
369369
if (cond) {
370-
const m = msg ? ': ' + msg : '';
371-
this.rec.debug(new Error('expect OK' + m));
370+
if (this.rec.debugging) {
371+
const m = msg ? ': ' + (typeof msg === 'function' ? msg() : msg) : '';
372+
this.rec.debug(new Error('expect OK' + m));
373+
}
372374
} else {
373-
this.rec.expectationFailed(new Error(msg));
375+
this.rec.expectationFailed(new Error(typeof msg === 'function' ? msg() : msg));
374376
}
375377
return cond;
376378
}

src/resources/cache/hashes.json

Lines changed: 110 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)