aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/utils.rs
diff options
context:
space:
mode:
authorKyle Sutherland-Cash <kyle.sutherlandcash@gmail.com>2021-02-05 10:28:34 +0000
committerGitHub <noreply@github.com>2021-02-05 11:28:34 +0100
commitb6fb330da3820dcb1959c1ce749b59f0150c9e21 (patch)
treebf6d83e64dfbc716d1a82f2b48401bdeb57e3453 /src/tests/utils.rs
parentMerge pull request #157 from mosaic-org/restructure (diff)
downloadsl0ppij-b6fb330da3820dcb1959c1ce749b59f0150c9e21.tar.gz
sl0ppij-b6fb330da3820dcb1959c1ce749b59f0150c9e21.tar.xz
sl0ppij-b6fb330da3820dcb1959c1ce749b59f0150c9e21.zip
refactor(input): hotkeys (#132)
* Initial definitions and thoughts for hotkeys * Actually document InputKey properly * Add a to string function for input keys * Define keybinds and actions; restructure * Implement hash and start on defining key bindings * Derive Serialize for input keys * Store the key strings as tuples for two-way mapping * Some string to key functions * Use termion's Key definition and implement action dispatch * Fix some borrow-checker errors * Missing keybind and command mode switching * Fix incorrect handling of spawn terminal command * fix(plugins): work with new input - tests not passing * fix(infra): stabilize tests and properly close pty sessions * style(fmt): rustfmt Co-authored-by: Brooks J Rady <b.j.rady@gmail.com> Co-authored-by: Aram Drevekenin <aram@poor.dev>
Diffstat (limited to 'src/tests/utils.rs')
-rw-r--r--src/tests/utils.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tests/utils.rs b/src/tests/utils.rs
index 63c953f6..b8ecaeae 100644
--- a/src/tests/utils.rs
+++ b/src/tests/utils.rs
@@ -36,6 +36,14 @@ pub fn get_output_frame_snapshots(
snapshots
}
+pub fn get_next_to_last_snapshot(mut snapshots: Vec<String>) -> Option<String> {
+ if snapshots.len() < 2 {
+ None
+ } else {
+ Some(snapshots.remove(snapshots.len() - 2))
+ }
+}
+
pub mod commands {
/// ctrl-g
pub const COMMAND_TOGGLE: [u8; 1] = [7];