mirror of
https://github.com/gitui-org/gitui.git
synced 2026-10-12 02:14:16 +00:00
Generated
+1
@@ -786,6 +786,7 @@ dependencies = [
|
||||
"serde",
|
||||
"simplelog",
|
||||
"syntect",
|
||||
"tempfile",
|
||||
"textwrap",
|
||||
"tui",
|
||||
"unicode-segmentation",
|
||||
|
||||
@@ -61,6 +61,7 @@ pprof = { version = "0.11", features = ["flamegraph"], optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "1.3"
|
||||
tempfile = "3.2"
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "actively-developed" }
|
||||
|
||||
@@ -226,7 +226,7 @@ impl StatusTreeComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a Vec<TextDrawInfo> which is used to draw the `FileTreeComponent` correctly,
|
||||
/// Returns a `Vec<TextDrawInfo>` which is used to draw the `FileTreeComponent` correctly,
|
||||
/// allowing folders to be folded up if they are alone in their directory
|
||||
fn build_vec_text_draw_info_for_drawing(
|
||||
&self,
|
||||
|
||||
@@ -210,3 +210,37 @@ impl KeysList {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::io::Write;
|
||||
use tempfile::NamedTempFile;
|
||||
|
||||
#[test]
|
||||
fn test_smoke() {
|
||||
let mut file = NamedTempFile::new().unwrap();
|
||||
|
||||
writeln!(
|
||||
file,
|
||||
r"
|
||||
(
|
||||
move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)),
|
||||
)
|
||||
"
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let keys = KeysList::init(file.path().to_path_buf());
|
||||
|
||||
assert_eq!(keys.move_right, KeysList::default().move_right);
|
||||
assert_eq!(
|
||||
keys.move_down,
|
||||
GituiKeyEvent::new(
|
||||
KeyCode::Char('j'),
|
||||
KeyModifiers::CONTROL
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user