mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
merge: Add test case to KeywordShiftedAlphabet algorithm (#1013)
This commit is contained in:
13
Ciphers/test/KeywordShiftedAlphabet.test.js
Normal file
13
Ciphers/test/KeywordShiftedAlphabet.test.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { encrypt, decrypt } from '../KeywordShiftedAlphabet'
|
||||||
|
|
||||||
|
test('Hello world! === dcrypt(encrypt(Hello world!))', () => {
|
||||||
|
const word = 'Hello world!'
|
||||||
|
const result = decrypt('keyword', encrypt('keyword', word))
|
||||||
|
expect(result).toMatch(word)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('The Algorithms === dcrypt(encrypt(The Algorithms))', () => {
|
||||||
|
const word = 'The Algorithms'
|
||||||
|
const result = decrypt('keyword', encrypt('keyword', word))
|
||||||
|
expect(result).toMatch(word)
|
||||||
|
})
|
Reference in New Issue
Block a user