before the great git rework
This commit is contained in:
@@ -7,7 +7,7 @@ import Testing
|
||||
private func route(_ press: KeyPress, _ context: KeyContext = KeyContext()) -> KeyRoute { KeyRouter.route(press, context) }
|
||||
|
||||
@Test(arguments: [
|
||||
("n", Command.showNote), ("p", .push), ("s", .save), ("m", .cycleMode), ("g", .toggleGit),
|
||||
("p", Command.push), ("s", .save), ("m", .cycleMode), ("g", .toggleGit),
|
||||
("l", .toggleAutoFit), (".", .toggleHidden), ("w", .closeFileOrWindow),
|
||||
])
|
||||
func commandLettersMapToTheirCommand(key: String, command: Command) {
|
||||
@@ -89,7 +89,7 @@ import Testing
|
||||
|
||||
@Test func escapeClosesAnOverlayAndOtherwiseReachesTheTerminal() {
|
||||
#expect(route(KeyPress(.escape), KeyContext(overlay: .other)) == .perform(.dismissOverlay))
|
||||
#expect(route(KeyPress(.escape), KeyContext(overlay: .note, owner: .text(in: nil))) == .perform(.dismissOverlay))
|
||||
#expect(route(KeyPress(.escape), KeyContext(overlay: .other, owner: .text(in: nil))) == .perform(.dismissOverlay))
|
||||
#expect(route(KeyPress(.escape), KeyContext(owner: .terminal)) == .pass)
|
||||
}
|
||||
|
||||
@@ -100,9 +100,8 @@ import Testing
|
||||
#expect(route(KeyPress(.right, command: true), search) == .pass)
|
||||
}
|
||||
|
||||
@Test func commandPPassesTheNoteWhileItIsOpen() {
|
||||
#expect(route(cmd("p"), KeyContext(overlay: .note)) == .perform(.passNote))
|
||||
#expect(route(cmd("g"), KeyContext(overlay: .note)) == .pass)
|
||||
@Test func commandNIsLeftUnbound() {
|
||||
#expect(route(cmd("n")) == .pass)
|
||||
}
|
||||
|
||||
@Test func theBareLauncherTakesArrowsAndEnter() {
|
||||
|
||||
Reference in New Issue
Block a user