KeePassTests.swift 731 B

12345678910111213141516171819202122232425262728
  1. import XCTest
  2. @testable import KeePass
  3. final class KeePassTests: XCTestCase {
  4. func testKDBX3() throws {
  5. let file = Bundle.module.url(forResource: "test-password-1234", withExtension: "kdbx")!
  6. let key = CompositeKey(password: "1234")
  7. let db = try KeePass.open(contentOf: file, compositeKey: key)
  8. print(db)
  9. }
  10. func testKDBX4() throws {
  11. let file = Bundle.module.url(forResource: "argon2-kdf-AES-cipher", withExtension: "kdbx")!
  12. let key = CompositeKey(password: "test")
  13. let db = try KeePass.open(contentOf: file, compositeKey: key)
  14. print(db)
  15. }
  16. static var allTests = [
  17. ("testKDBX3", testKDBX3),
  18. ("testKDBX4", testKDBX4),
  19. ]
  20. }