merge: Round-trip testing for Atbash cipher (#958)

- fix the test description
This commit is contained in:
TrasherDK
2022-03-28 12:20:16 +07:00
committed by GitHub
parent 54760214df
commit 1249dbe202

View File

@ -1,7 +1,7 @@
import Atbash from '../Atbash' import Atbash from '../Atbash'
describe('Testing Atbash function', () => { 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(0x345)).toThrow()
expect(() => Atbash(123)).toThrow() expect(() => Atbash(123)).toThrow()
expect(() => Atbash(123n)).toThrow() expect(() => Atbash(123n)).toThrow()
@ -10,8 +10,9 @@ describe('Testing Atbash function', () => {
expect(() => Atbash([])).toThrow() expect(() => Atbash([])).toThrow()
}) })
it('Test - 2, passing all alphabets', () => { it('Test - 2, passing a string as an argument', () => {
expect(Atbash('HELLO WORLD')).toBe('SVOOL DLIOW') const clearText = 'The quick brown fox jumps over the lazy dog'
expect(Atbash('The quick brown fox jumps over the lazy dog')).toBe('Gsv jfrxp yildm ulc qfnkh levi gsv ozab wlt') const cryptText = Atbash(clearText)
expect(Atbash(cryptText)).toBe(clearText)
}) })
}) })