Fixed autotype for fields containing curly brackets

This commit is contained in:
michael starke
2014-08-20 01:24:36 +02:00
parent 4acfde5117
commit 472289f7d7
2 changed files with 15 additions and 6 deletions

View File

@@ -44,22 +44,25 @@
KPKEntry *entry = [[KPKEntry alloc] init];
entry.title = @"Title";
entry.url = @"www.myurl.com";
entry.username = @"Username";
entry.password = @"Password";
entry.username = @"{{User{name}}}";
entry.password = @"Pass{word}";
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:@"{USERNAME}{TAB}{PASSWORD}{ENTER}"];
NSArray *commands = [MPAutotypeCommand commandsForContext:context];
XCTAssert([commands count] == 4);
XCTAssert([commands count] == 7);
XCTAssert([commands[0] isKindOfClass:[MPAutotypePaste class]]);
XCTAssert([commands[1] isKindOfClass:[MPAutotypeKeyPress class]]);
XCTAssert([commands[1] isKindOfClass:[MPAutotypePaste class]]);
XCTAssert([commands[2] isKindOfClass:[MPAutotypePaste class]]);
XCTAssert([commands[3] isKindOfClass:[MPAutotypeKeyPress class]]);
XCTAssert([commands[4] isKindOfClass:[MPAutotypePaste class]]);
XCTAssert([commands[5] isKindOfClass:[MPAutotypePaste class]]);
XCTAssert([commands[6] isKindOfClass:[MPAutotypeKeyPress class]]);
context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:@"^T{USERNAME}%+^{TAB}Whoo{PASSWORD}{ENTER}"];
commands = [MPAutotypeCommand commandsForContext:context];
XCTAssert([commands count] == 5);
//XCTAssert([commands count] == 5);
}
@end