Sha256: 57736cd421d1db4dee837d85779fc80a85306a95d9ef6ae404e34f6681cc2566

Contents?: true

Size: 1.03 KB

Versions: 396

Compression:

Stored size: 1.03 KB

Contents

local encode = require('atbash-cipher').encode

describe('atbash-cipher', function()
  it('should encode single letter plaintexts', function()
    assert.are.equal('m', encode('n'))
  end)

  it('should encode single-chunk plaintexts', function()
    assert.are.equal('svool', encode('hello'))
  end)

  it('should encode multi-chunk plaintexts', function()
    assert.are.equal('nrmwy oldrm tob', encode('mindblowingly'))
  end)

  it('should encode all letters as lower-case', function()
    assert.are.equal('svool', encode('HeLLo'))
  end)

  it('should not encode whitespace', function()
    assert.are.equal('svool', encode('h e l l o'))
  end)

  it('should not encode punctuation', function()
    assert.are.equal('svool', encode('h,e,l,l,o'))
  end)

  it('should not encode numbers', function()
    assert.are.equal('sv11l', encode('he11o'))
  end)

  it('should encode all letters', function()
    assert.are.equal(
      'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt',
      encode('The quick brown fox jumps over the lazy dog.')
    )
  end)
end)

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.179 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.178 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.177 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.176 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.175 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.174 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.173 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.172 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.171 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.170 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.169 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.167 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.166 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.165 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.164 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.163 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.162 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.161 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua
trackler-2.2.1.160 tracks/lua/exercises/atbash-cipher/atbash-cipher_spec.lua