mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
merge: Round-trip testing for Atbash cipher (#958)
- fix the test description
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import Atbash from '../Atbash'
|
||||
|
||||
describe('Testing Atbash function', () => {
|
||||
it('Test - 1, passing the non-string as an argument', () => {
|
||||
it('Test - 1, passing a non-string as an argument', () => {
|
||||
expect(() => Atbash(0x345)).toThrow()
|
||||
expect(() => Atbash(123)).toThrow()
|
||||
expect(() => Atbash(123n)).toThrow()
|
||||
@ -10,8 +10,9 @@ describe('Testing Atbash function', () => {
|
||||
expect(() => Atbash([])).toThrow()
|
||||
})
|
||||
|
||||
it('Test - 2, passing all alphabets', () => {
|
||||
expect(Atbash('HELLO WORLD')).toBe('SVOOL DLIOW')
|
||||
expect(Atbash('The quick brown fox jumps over the lazy dog')).toBe('Gsv jfrxp yildm ulc qfnkh levi gsv ozab wlt')
|
||||
it('Test - 2, passing a string as an argument', () => {
|
||||
const clearText = 'The quick brown fox jumps over the lazy dog'
|
||||
const cryptText = Atbash(clearText)
|
||||
expect(Atbash(cryptText)).toBe(clearText)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user