Skip to content

Commit 1249dbe

Browse files
authored
merge: Round-trip testing for Atbash cipher (TheAlgorithms#958)
- fix the test description
1 parent 5476021 commit 1249dbe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Ciphers/test/Atbash.test.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Atbash from '../Atbash'
22

33
describe('Testing Atbash function', () => {
4-
it('Test - 1, passing the non-string as an argument', () => {
4+
it('Test - 1, passing a non-string as an argument', () => {
55
expect(() => Atbash(0x345)).toThrow()
66
expect(() => Atbash(123)).toThrow()
77
expect(() => Atbash(123n)).toThrow()
@@ -10,8 +10,9 @@ describe('Testing Atbash function', () => {
1010
expect(() => Atbash([])).toThrow()
1111
})
1212

13-
it('Test - 2, passing all alphabets', () => {
14-
expect(Atbash('HELLO WORLD')).toBe('SVOOL DLIOW')
15-
expect(Atbash('The quick brown fox jumps over the lazy dog')).toBe('Gsv jfrxp yildm ulc qfnkh levi gsv ozab wlt')
13+
it('Test - 2, passing a string as an argument', () => {
14+
const clearText = 'The quick brown fox jumps over the lazy dog'
15+
const cryptText = Atbash(clearText)
16+
expect(Atbash(cryptText)).toBe(clearText)
1617
})
1718
})

0 commit comments

Comments
 (0)