Sha256: e4544fc591d4294d5ce90f8b59980202e791f44c2193a63ebbed83c9fa56f4b4
Contents?: true
Size: 1.55 KB
Versions: 320
Compression:
Stored size: 1.55 KB
Contents
import XCTest @testable import Atbash class AtbashTests: XCTestCase { func testEncodeNo() { XCTAssertEqual("ml", Atbash.encode("no") ) } func testEncodeYes() { XCTAssertEqual("bvh", Atbash.encode("yes") ) } func testEncodeOMG() { XCTAssertEqual("lnt", Atbash.encode("OMG") ) } func testEncodeOMGWithSpaces() { XCTAssertEqual("lnt", Atbash.encode("O M G") ) } func testEncodeLongWord() { XCTAssertEqual("nrmwy oldrm tob", Atbash.encode("mindblowingly") ) } func testEncodeNumbers() { XCTAssertEqual("gvhgr mt123 gvhgr mt", Atbash.encode("Testing, 1 2 3, testing.") ) } func testEncodeSentence() { XCTAssertEqual("gifgs rhurx grlm", Atbash.encode("Truth is fiction.") ) } func testEncodeAllTheThings() { let plaintext = "The quick brown fox jumps over the lazy dog." let cipher = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt" XCTAssertEqual(cipher, Atbash.encode(plaintext) ) } static var allTests: [(String, (AtbashTests) -> () throws -> Void)] { return [ ("testEncodeNo", testEncodeNo), ("testEncodeYes", testEncodeYes), ("testEncodeOMG", testEncodeOMG), ("testEncodeOMGWithSpaces", testEncodeOMGWithSpaces), ("testEncodeLongWord", testEncodeLongWord), ("testEncodeNumbers", testEncodeNumbers), ("testEncodeSentence", testEncodeSentence), ("testEncodeAllTheThings", testEncodeAllTheThings), ] } }
Version data entries
320 entries across 320 versions & 1 rubygems