Skip to content

Commit 88bf9b7

Browse files
committed
test: optimize unit test
1 parent 16d62c6 commit 88bf9b7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/script.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ describe('script', () => {
5252
});
5353

5454
it("decodes a series of numbers from '82 to 96' correctly", () => {
55-
const asm = Array.from({ length: 15 }, (_, i) =>
56-
(i + 130).toString(16).padStart(2, '0'),
57-
).join(' ');
55+
const asm = Array.from({ length: 15 }, (_, i) => i + 82).join(' ');
5856
const expected = Array.from({ length: 15 }, (_, i) => [
5957
1,
60-
i + 130,
58+
parseInt(String(i + 82), 16),
6159
]).flat();
6260
const result = bscript.fromASM(asm);
6361
assert.deepStrictEqual(result, Uint8Array.from(expected));

0 commit comments

Comments
 (0)