Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25add22

Browse files
"test: add missing coverage for Substitution Cipher decryption edge cases"
1 parentb9432a0 commit25add22

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎Ciphers/test/SubstitutionCipher.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@ describe('Substitution Cipher', () => {
2727
RangeError
2828
)
2929
})
30+
it('encrypts using default key if none provided',()=>{
31+
constencrypted=substitutionCipherEncryption('HELLO WORLD')
32+
expect(encrypted).toBe('ITSSG VGKSR')
33+
})
34+
35+
it('decrypts using default key if none provided',()=>{
36+
constdecrypted=substitutionCipherDecryption('ITSSG VGKSR')
37+
expect(decrypted).toBe('HELLO WORLD')
38+
})
39+
40+
it('throws error for invalid key in decryption',()=>{
41+
expect(()=>substitutionCipherDecryption('HELLO','BADKEY')).toThrow(RangeError)
42+
})
43+
3044
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp