Get username from filepath. (#265)

This commit is contained in:
Meris Bahtijaragic 2019-05-17 17:30:41 +02:00 committed by Yishi Lin
parent b154c04178
commit c59c72729b
3 changed files with 12 additions and 1 deletions

View file

@ -239,6 +239,13 @@ class PasswordTest: XCTestCase {
XCTAssert(MULTILINE_LINE_START.title => "" password)
}
func testUsernameInPath() {
let password = getPasswordObjectWith(content: "", url: URL(fileURLWithPath: "exampleservice/exampleusername.pgp"))
XCTAssertEqual(password.nameFromPath, "exampleusername")
}
func testMultilineValues() {
let lineBreakField = "with line breaks" => "|\n This is \n text spread over \n multiple lines! "
let noLineBreakField = "without line breaks" => " > \n This is \n text spread over\n multiple lines!"