aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/possible_tty_inputs.rs
diff options
context:
space:
mode:
authorDenis Maximov <denismaximov98@gmail.com>2020-11-14 19:59:37 +0200
committerGitHub <noreply@github.com>2020-11-14 18:59:37 +0100
commita2914066bf0e2e2bf5caee263d2378b7d77f477f (patch)
tree2a87397c32e2d9f512ad0c886107aa5c2e57d68e /src/tests/possible_tty_inputs.rs
parentHOTFIX: do not get os input unless we're starting the app (diff)
downloadsl0ppij-a2914066bf0e2e2bf5caee263d2378b7d77f477f.tar.gz
sl0ppij-a2914066bf0e2e2bf5caee263d2378b7d77f477f.tar.xz
sl0ppij-a2914066bf0e2e2bf5caee263d2378b7d77f477f.zip
feat: add rustfmt, update action workflow to check for formatting (#45)
Diffstat (limited to 'src/tests/possible_tty_inputs.rs')
-rw-r--r--src/tests/possible_tty_inputs.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tests/possible_tty_inputs.rs b/src/tests/possible_tty_inputs.rs
index dd6e1e7d..6730591f 100644
--- a/src/tests/possible_tty_inputs.rs
+++ b/src/tests/possible_tty_inputs.rs
@@ -1,7 +1,10 @@
+use crate::tests::tty_inputs::{
+ COL_10, COL_121, COL_14, COL_15, COL_19, COL_20, COL_24, COL_29, COL_30, COL_34, COL_39,
+ COL_40, COL_50, COL_60, COL_70, COL_90,
+};
use std::collections::HashMap;
use std::fs;
use std::path::PathBuf;
-use crate::tests::tty_inputs::{COL_10, COL_60, COL_14, COL_15, COL_19, COL_20, COL_24, COL_29, COL_30, COL_34, COL_39, COL_40, COL_50, COL_70, COL_90, COL_121};
#[derive(Clone, Debug)]
pub struct Bytes {
@@ -13,7 +16,7 @@ impl Bytes {
pub fn new() -> Self {
Bytes {
content: vec![],
- read_position: 0
+ read_position: 0,
}
}
pub fn from_file_in_fixtures(file_name: &str) -> Self {
@@ -22,10 +25,11 @@ impl Bytes {
path_to_file.push("tests");
path_to_file.push("fixtures");
path_to_file.push(file_name);
- let content = fs::read(path_to_file).expect(&format!("could not read fixture {:?}", &file_name));
+ let content =
+ fs::read(path_to_file).expect(&format!("could not read fixture {:?}", &file_name));
Bytes {
content,
- read_position: 0
+ read_position: 0,
}
}
pub fn content_from_str(mut self, content: &[&'static str]) -> Self {
@@ -43,7 +47,8 @@ impl Bytes {
}
}
-pub fn get_possible_tty_inputs () -> HashMap<u16, Bytes> { // the key is the column count for this terminal input
+pub fn get_possible_tty_inputs() -> HashMap<u16, Bytes> {
+ // the key is the column count for this terminal input
let mut possible_inputs = HashMap::new();
let col_10_bytes = Bytes::new().content_from_str(&COL_10);
let col_14_bytes = Bytes::new().content_from_str(&COL_14);