mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 09:28:26 +08:00
@ -19,7 +19,7 @@ describe('Test Affine Cipher', () => {
|
||||
expect(() => encrypt('null', 4, 1)).toThrow()
|
||||
})
|
||||
|
||||
it('Test - 3 Pass string value to encrypt and ecrypt function', () => {
|
||||
it('Test - 3 Pass string value to encrypt and decrypt function', () => {
|
||||
expect(decrypt(encrypt('HELLO WORLD', 5, 8), 5, 8)).toBe('HELLO WORLD')
|
||||
expect(decrypt(encrypt('ABC DEF', 3, 5), 3, 5)).toBe('ABC DEF')
|
||||
expect(decrypt(encrypt('Brown fox jump over the fence', 7, 3), 7, 3)).toBe(
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { encrypt, decrypt } from '../KeywordShiftedAlphabet'
|
||||
|
||||
test('Hello world! === dcrypt(encrypt(Hello world!))', () => {
|
||||
test('Hello world! === decrypt(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))', () => {
|
||||
test('The Algorithms === decrypt(encrypt(The Algorithms))', () => {
|
||||
const word = 'The Algorithms'
|
||||
const result = decrypt('keyword', encrypt('keyword', word))
|
||||
expect(result).toMatch(word)
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { encrypt, decrypt } from '../VigenereCipher'
|
||||
|
||||
test('Hello world! === dcrypt(encrypt(Hello world!))', () => {
|
||||
test('Hello world! === decrypt(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))', () => {
|
||||
test('The Algorithms === decrypt(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