Skip to content

Commit

Permalink
Add test for normalizing zero (#317)
Browse files Browse the repository at this point in the history
A test has been added to capture the behavior of the `normalize`
function when a zero is passed in. This behavior changed recently in
PR #315.
  • Loading branch information
Gudahtt authored Jun 29, 2023
1 parent 89035e2 commit 4b84549
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ describe('normalize', function () {
expect(result).toBe(`0x${initial.toLowerCase()}`);
});

it('should normalize 0 to a byte-pair hex string', function () {
const initial = 0;
const result = normalize(initial);
expect(result).toBe('0x00');
});

it('should normalize an integer to a byte-pair hex string', function () {
const initial = 1;
const result = normalize(initial);
Expand Down

0 comments on commit 4b84549

Please sign in to comment.