mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
merge: Add test case to Vigenere Cipher Algorithm (#1017)
This commit is contained in:
13
Ciphers/test/VigenereCipher.test.js
Normal file
13
Ciphers/test/VigenereCipher.test.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { encrypt, decrypt } from '../VigenereCipher'
|
||||||
|
|
||||||
|
test('Hello world! === dcrypt(encrypt(Hello world!))', () => {
|
||||||
|
const word = 'Hello world!'
|
||||||
|
const result = decrypt(encrypt(word, 'code'), 'code')
|
||||||
|
expect(result).toMatch(word)
|
||||||
|
})
|
||||||
|
|
||||||
|
test('The Algorithms === dcrypt(encrypt(The Algorithms))', () => {
|
||||||
|
const word = 'The Algorithms'
|
||||||
|
const result = decrypt(encrypt(word, 'code'), 'code')
|
||||||
|
expect(result).toMatch(word)
|
||||||
|
})
|
Reference in New Issue
Block a user