Skip to content

Commit

Permalink
test: optimize unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
decentraldev1 committed Dec 26, 2024
1 parent 16d62c6 commit 88bf9b7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/script.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ describe('script', () => {
});

it("decodes a series of numbers from '82 to 96' correctly", () => {
const asm = Array.from({ length: 15 }, (_, i) =>
(i + 130).toString(16).padStart(2, '0'),
).join(' ');
const asm = Array.from({ length: 15 }, (_, i) => i + 82).join(' ');
const expected = Array.from({ length: 15 }, (_, i) => [
1,
i + 130,
parseInt(String(i + 82), 16),
]).flat();
const result = bscript.fromASM(asm);
assert.deepStrictEqual(result, Uint8Array.from(expected));
Expand Down

0 comments on commit 88bf9b7

Please sign in to comment.