Add modal input state and rails
This commit is contained in:
@@ -491,6 +491,7 @@ test "regular: local editor client exposes save and dirty quit guards" {
|
||||
defer std.testing.allocator.free(initial);
|
||||
try std.testing.expectEqualStrings("", initial);
|
||||
|
||||
try client.handleInput("i");
|
||||
try client.handleInput("h");
|
||||
try client.handleInput("e");
|
||||
try client.handleInput("l");
|
||||
@@ -500,12 +501,19 @@ test "regular: local editor client exposes save and dirty quit guards" {
|
||||
defer std.testing.allocator.free(edited);
|
||||
try std.testing.expectEqualStrings("hello", edited);
|
||||
|
||||
try client.handleInput(" ");
|
||||
try std.testing.expectEqualStrings("insert_space", client.pendingRailName());
|
||||
try client.handleInput("n");
|
||||
try std.testing.expectEqualStrings("normal", client.modeName());
|
||||
try client.handleInput(" ");
|
||||
try client.handleInput("s");
|
||||
try std.testing.expectEqualStrings("hello", try client.saved());
|
||||
|
||||
try client.handleInput("i");
|
||||
try client.handleInput("!");
|
||||
try client.handleInput(" ");
|
||||
try client.handleInput("n");
|
||||
try client.handleInput(" ");
|
||||
try client.handleInput("q");
|
||||
try std.testing.expect(client.requestedQuit());
|
||||
client.clearQuit();
|
||||
|
||||
Reference in New Issue
Block a user