diff options
author | 2023-06-20 17:12:47 -0700 | |
---|---|---|
committer | 2023-06-20 17:12:47 -0700 | |
commit | 83d7ec728f073261176b0bea8451b936c5a376ad (patch) | |
tree | d7cd3c9343ee27bcc04211f8bb394189ed73e900 /test/js/node/crypto/crypto.test.ts | |
parent | 9f301e13c5d8f057e6e9308e23cba7ecc27dab09 (diff) | |
download | bun-83d7ec728f073261176b0bea8451b936c5a376ad.tar.gz bun-83d7ec728f073261176b0bea8451b936c5a376ad.tar.zst bun-83d7ec728f073261176b0bea8451b936c5a376ad.zip |
Clone SourceOrigin string
Diffstat (limited to 'test/js/node/crypto/crypto.test.ts')
-rw-r--r-- | test/js/node/crypto/crypto.test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/js/node/crypto/crypto.test.ts b/test/js/node/crypto/crypto.test.ts index d03940b9f..d8bfe5353 100644 --- a/test/js/node/crypto/crypto.test.ts +++ b/test/js/node/crypto/crypto.test.ts @@ -88,6 +88,15 @@ describe("CryptoHasher", () => { expect(copy.digest("hex")).not.toBe(orig.digest("hex")); }); + it(`CryptoHasher ${alg} copy can be used after digest()`, () => { + const orig = new CryptoHasher(alg); + orig.update("hello"); + orig.digest("hex"); + const copy = orig.copy(); + + expect(() => copy.digest("hex")).not.toThrow(); + }); + it(`CryptoHasher ${alg} copy updates the same`, () => { const orig = new CryptoHasher(alg); orig.update("hello"); |