Skip to content

Commit

Permalink
Fix incorrect property usage in SimpleCipherTests to use 'count' inst…
Browse files Browse the repository at this point in the history
…ead of 'length'
  • Loading branch information
meatball133 committed Jan 2, 2025
1 parent b351a88 commit ded1d63
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let RUNALL = Bool(ProcessInfo.processInfo.environment["RUNALL"] ?? "false") ?? f
let cipher = Cipher()
let plaintext = "aaaaaaaaaa"
let expected = String(
cipher.key[..<cipher.key.index(cipher.key.startIndex, offsetBy: plaintext.length)])
cipher.key[..<cipher.key.index(cipher.key.startIndex, offsetBy: plaintext.count)])
#expect(expected == cipher.encode(plaintext))
}

Expand All @@ -20,7 +20,7 @@ let RUNALL = Bool(ProcessInfo.processInfo.environment["RUNALL"] ?? "false") ?? f
let cipher = Cipher()
let plaintext = "aaaaaaaaaa"
let expected = String(
cipher.key[..<cipher.key.index(cipher.key.startIndex, offsetBy: plaintext.length)])
cipher.key[..<cipher.key.index(cipher.key.startIndex, offsetBy: plaintext.count)])
#expect(plaintext == cipher.decode(expected))
}

Expand Down

0 comments on commit ded1d63

Please sign in to comment.