Skip to content

Commit

Permalink
test: Updated MemoryImage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor-pelykh committed Feb 3, 2024
1 parent fbeb46b commit 868a471
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/image/image.base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,22 @@ describe('Image', () => {
output
);
});

test('GetBytes rgb -> argb', () => {
const i1 = new MemoryImage({
width: 1,
height: 1,
});
i1.setPixelRgb(0, 0, 32, 64, 128);

const b1 = i1.getBytes({
order: ChannelOrder.argb,
});

expect(b1.length).toBe(4);
expect(b1[0]).toBe(255);
expect(b1[1]).toBe(32);
expect(b1[2]).toBe(64);
expect(b1[3]).toBe(128);
});
});

0 comments on commit 868a471

Please sign in to comment.