apple2js/test/js/formats/util.spec.ts

24 lines
558 B
TypeScript
Raw Normal View History

import { compareSequences } from './util';
describe('compareSequences', () => {
it('matches at pos 0', () => {
expect(
2021-02-08 05:54:11 +00:00
compareSequences(
new Uint8Array([0x01, 0x02, 0x03]),
[0x01, 0x02, 0x03],
0
)
).toBeTruthy();
});
it('matches at pos 1', () => {
expect(
2021-02-08 05:54:11 +00:00
compareSequences(
new Uint8Array([0x00, 0x01, 0x02, 0x03]),
[0x01, 0x02, 0x03],
1
)
).toBeTruthy();
});
});