From e6242c4d8a62525ab33e0f67c9298d7f0ab5bfe1 Mon Sep 17 00:00:00 2001 From: pagedmov Date: Tue, 24 Feb 2026 18:02:13 -0500 Subject: [PATCH] changed package name from 'fern' to 'shed' --- Cargo.lock | 38 +++++++++++++++++----------------- Cargo.toml | 4 ++-- README.md | 2 +- flake.nix | 12 +++++------ nix/hm-module.nix | 22 ++++++++++---------- nix/module.nix | 10 ++++----- src/expand.rs | 2 +- src/libsh/flog.rs | 12 +++++------ src/main.rs | 28 ++++++++++++------------- src/prelude.rs | 2 +- src/prompt/readline/history.rs | 2 +- src/prompt/readline/mod.rs | 4 ++-- src/prompt/readline/term.rs | 2 +- src/shopt.rs | 24 ++++++++++----------- src/state.rs | 38 +++++++++++++++++----------------- src/tests/readline.rs | 34 +++++++++++++++--------------- src/tests/script.rs | 24 ++++++++++----------- 17 files changed, 130 insertions(+), 130 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0218b56..8d53151 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -194,25 +194,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" -[[package]] -name = "fern" -version = "0.3.0" -dependencies = [ - "bitflags", - "clap", - "env_logger", - "glob", - "insta", - "log", - "nix", - "pretty_assertions", - "regex", - "tempfile", - "unicode-segmentation", - "unicode-width", - "vte", -] - [[package]] name = "getrandom" version = "0.3.4" @@ -438,6 +419,25 @@ dependencies = [ "syn", ] +[[package]] +name = "shed" +version = "0.3.0" +dependencies = [ + "bitflags", + "clap", + "env_logger", + "glob", + "insta", + "log", + "nix", + "pretty_assertions", + "regex", + "tempfile", + "unicode-segmentation", + "unicode-width", + "vte", +] + [[package]] name = "similar" version = "2.7.0" diff --git a/Cargo.toml b/Cargo.toml index bd4a266..15e27e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fern" +name = "shed" description = "A linux shell written in rust" publish = false version = "0.3.0" @@ -27,4 +27,4 @@ pretty_assertions = "1.4.1" tempfile = "3.24.0" [[bin]] -name = "fern" +name = "shed" diff --git a/README.md b/README.md index 87b56ce..2428964 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# fern +# shed A shell program written in Rust for Unix based operating systems. This is mostly a pet project, still largely a work in progress, though it is being designed with end-users in mind. Will add more to this readme as features are implemented. diff --git a/flake.nix b/flake.nix index 79bc915..651d1e4 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,7 @@ in { packages.default = pkgs.rustPlatform.buildRustPackage { - pname = "fern"; + pname = "shed"; version = "0.3.0"; src = self; @@ -23,22 +23,22 @@ }; doCheck = false; - passthru.shellPath = "/bin/fern"; + passthru.shellPath = "/bin/shed"; meta = with pkgs.lib; { description = "A Linux shell written in Rust"; - homepage = "https://github.com/km-clay/fern"; + homepage = "https://github.com/km-clay/shed"; license = licenses.mit; maintainers = [ ]; platforms = platforms.linux; }; }; }) // { - nixosModules.fern = import ./nix/module.nix; - homeModules.fern = import ./nix/hm-module.nix; + nixosModules.shed = import ./nix/module.nix; + homeModules.shed = import ./nix/hm-module.nix; overlays.default = final: prev: { - fern = self.packages.${final.stdenv.hostPlatform.system}.default; + shed = self.packages.${final.stdenv.hostPlatform.system}.default; }; }; } diff --git a/nix/hm-module.nix b/nix/hm-module.nix index a18cf38..93fd66a 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -1,30 +1,30 @@ { config, lib, pkgs, ... }: let - cfg = config.programs.fern; + cfg = config.programs.shed; boolToString = b: if b then "true" else "false"; in { - options.programs.fern = { - enable = lib.mkEnableOption "fern shell"; + options.programs.shed = { + enable = lib.mkEnableOption "shed shell"; package = lib.mkOption { type = lib.types.package; - default = pkgs.fern; - description = "The fern package to use"; + default = pkgs.shed; + description = "The shed package to use"; }; aliases = lib.mkOption { type = lib.types.attrsOf lib.types.str; default = {}; - description = "The command name to use for the fern shell"; + description = "Aliases to set when shed starts (e.g. ls='ls --color=auto')"; }; environmentVars = lib.mkOption { type = lib.types.attrsOf lib.types.str; default = {}; - description = "Environment variables to set when fern starts"; + description = "Environment variables to set when shed starts"; }; settings = { @@ -61,7 +61,7 @@ in bellEnabled = lib.mkOption { type = lib.types.bool; default = true; - description = "Whether to allow fern to ring the terminal bell on certain events (e.g. command completion, errors, etc.)"; + description = "Whether to allow shed to ring the terminal bell on certain events (e.g. command completion, errors, etc.)"; }; maxRecurseDepth = lib.mkOption { type = lib.types.int; @@ -92,12 +92,12 @@ in extraPostConfig = lib.mkOption { type = lib.types.str; default = ""; - description = "Additional configuration to append to the fern configuration file"; + description = "Additional configuration to append to the shed configuration file"; }; extraPreConfig = lib.mkOption { type = lib.types.str; default = ""; - description = "Additional configuration to prepend to the fern configuration file"; + description = "Additional configuration to prepend to the shed configuration file"; }; }; }; @@ -105,7 +105,7 @@ in config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; - home.file.".fernrc".text = lib.concatLines [ + home.file.".shedrc".text = lib.concatLines [ cfg.settings.extraPreConfig (lib.concatLines (lib.mapAttrsToList (name: value: "export ${name}=\"${value}\"") cfg.environmentVars)) (lib.concatLines (lib.mapAttrsToList (name: value: "alias ${name}=\"${value}\"") cfg.aliases)) diff --git a/nix/module.nix b/nix/module.nix index a1871c1..75d04bc 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -1,16 +1,16 @@ { config, lib, pkgs, ... }: let - cfg = config.programs.fern; + cfg = config.programs.shed; in { - options.programs.fern = { - enable = lib.mkEnableOption "fern shell"; + options.programs.shed = { + enable = lib.mkEnableOption "shed shell"; package = lib.mkOption { type = lib.types.package; - default = pkgs.fern; - description = "The fern package to use"; + default = pkgs.shed; + description = "The shed package to use"; }; }; diff --git a/src/expand.rs b/src/expand.rs index 93cc4f3..9bd919a 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -2002,7 +2002,7 @@ pub fn expand_prompt(raw: &str) -> ShResult { result.push_str(&hostname); } PromptTk::HostnameShort => todo!(), - PromptTk::ShellName => result.push_str("fern"), + PromptTk::ShellName => result.push_str("shed"), PromptTk::Username => { let username = std::env::var("USER").unwrap(); result.push_str(&username); diff --git a/src/libsh/flog.rs b/src/libsh/flog.rs index 45438d4..5f49fa1 100644 --- a/src/libsh/flog.rs +++ b/src/libsh/flog.rs @@ -4,7 +4,7 @@ use super::term::{Style, Styled}; #[derive(Clone, Copy, PartialEq, PartialOrd, Ord, Eq, Debug)] #[repr(u8)] -pub enum FernLogLevel { +pub enum ShedLogLevel { NONE = 0, ERROR = 1, WARN = 2, @@ -13,9 +13,9 @@ pub enum FernLogLevel { TRACE = 5, } -impl Display for FernLogLevel { +impl Display for ShedLogLevel { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - use FernLogLevel::*; + use ShedLogLevel::*; match self { ERROR => write!(f, "{}", "ERROR".styled(Style::Red | Style::Bold)), WARN => write!(f, "{}", "WARN".styled(Style::Yellow | Style::Bold)), @@ -27,8 +27,8 @@ impl Display for FernLogLevel { } } -pub fn log_level() -> FernLogLevel { - use FernLogLevel::*; +pub fn log_level() -> ShedLogLevel { + use ShedLogLevel::*; let level = std::env::var("FERN_LOG_LEVEL").unwrap_or_default(); match level.to_lowercase().as_str() { "error" => ERROR, @@ -40,7 +40,7 @@ pub fn log_level() -> FernLogLevel { } } -/// A structured logging macro designed for `fern`. +/// A structured logging macro designed for `shed`. /// /// `flog!` was implemented because `rustyline` uses `env_logger`, which /// clutters the debug output. This macro prints log messages in a structured diff --git a/src/main.rs b/src/main.rs index 99aed34..d6af0a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,14 +33,14 @@ use crate::parse::execute::exec_input; use crate::prelude::*; use crate::prompt::get_prompt; use crate::prompt::readline::term::{RawModeGuard, raw_mode}; -use crate::prompt::readline::{FernVi, ReadlineEvent}; +use crate::prompt::readline::{ShedVi, ReadlineEvent}; use crate::signal::{QUIT_CODE, check_signals, sig_setup, signals_pending}; use crate::state::{read_logic, source_rc, write_jobs, write_meta}; use clap::Parser; use state::{read_vars, write_vars}; #[derive(Parser, Debug)] -struct FernArgs { +struct ShedArgs { script: Option, #[arg(short)] @@ -77,8 +77,8 @@ fn kickstart_lazy_evals() { fn setup_panic_handler() { let default_panic_hook = std::panic::take_hook(); std::panic::set_hook(Box::new(move |info| { - let _ = state::FERN.try_with(|fern| { - if let Ok(mut jobs) = fern.jobs.try_borrow_mut() { + let _ = state::FERN.try_with(|shed| { + if let Ok(mut jobs) = shed.jobs.try_borrow_mut() { jobs.hang_up(); } }); @@ -92,14 +92,14 @@ fn main() -> ExitCode { kickstart_lazy_evals(); setup_panic_handler(); - let mut args = FernArgs::parse(); + let mut args = ShedArgs::parse(); if env::args().next().is_some_and(|a| a.starts_with('-')) { - // first arg is '-fern' + // first arg is '-shed' // meaning we are in a login shell args.login_shell = true; } if args.version { - println!("fern {} ({} {})", env!("CARGO_PKG_VERSION"), std::env::consts::ARCH, std::env::consts::OS); + println!("shed {} ({} {})", env!("CARGO_PKG_VERSION"), std::env::consts::ARCH, std::env::consts::OS); return ExitCode::SUCCESS; } @@ -108,14 +108,14 @@ fn main() -> ExitCode { } else if let Some(cmd) = args.command { exec_input(cmd, None, false) } else { - fern_interactive() + shed_interactive() } { - eprintln!("fern: {e}"); + eprintln!("shed: {e}"); }; if let Some(trap) = read_logic(|l| l.get_trap(TrapTarget::Exit)) && let Err(e) = exec_input(trap, None, false) { - eprintln!("fern: error running EXIT trap: {e}"); + eprintln!("shed: error running EXIT trap: {e}"); } write_jobs(|j| j.hang_up()); @@ -125,7 +125,7 @@ fn main() -> ExitCode { fn run_script>(path: P, args: Vec) -> ShResult<()> { let path = path.as_ref(); if !path.is_file() { - eprintln!("fern: Failed to open input file: {}", path.display()); + eprintln!("shed: Failed to open input file: {}", path.display()); QUIT_CODE.store(1, Ordering::SeqCst); return Err(ShErr::simple( ShErrKind::CleanExit(1), @@ -133,7 +133,7 @@ fn run_script>(path: P, args: Vec) -> ShResult<()> { )); } let Ok(input) = fs::read_to_string(path) else { - eprintln!("fern: Failed to read input file: {}", path.display()); + eprintln!("shed: Failed to read input file: {}", path.display()); QUIT_CODE.store(1, Ordering::SeqCst); return Err(ShErr::simple( ShErrKind::CleanExit(1), @@ -152,7 +152,7 @@ fn run_script>(path: P, args: Vec) -> ShResult<()> { exec_input(input, None, false) } -fn fern_interactive() -> ShResult<()> { +fn shed_interactive() -> ShResult<()> { let _raw_mode = raw_mode(); // sets raw mode, restores termios on drop sig_setup(); @@ -161,7 +161,7 @@ fn fern_interactive() -> ShResult<()> { } // Create readline instance with initial prompt - let mut readline = match FernVi::new(get_prompt().ok(), *TTY_FILENO) { + let mut readline = match ShedVi::new(get_prompt().ok(), *TTY_FILENO) { Ok(rl) => rl, Err(e) => { eprintln!("Failed to initialize readline: {e}"); diff --git a/src/prelude.rs b/src/prelude.rs index cfc238e..aa9a2c2 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -34,6 +34,6 @@ pub use nix::{ }; pub use crate::flog; -pub use crate::libsh::flog::FernLogLevel::*; +pub use crate::libsh::flog::ShedLogLevel::*; // Additional utilities, if needed, can be added here diff --git a/src/prompt/readline/history.rs b/src/prompt/readline/history.rs index 0662bd6..86058a4 100644 --- a/src/prompt/readline/history.rs +++ b/src/prompt/readline/history.rs @@ -226,7 +226,7 @@ impl History { let max_hist = crate::state::read_shopts(|s| s.core.max_hist); let path = PathBuf::from(env::var("FERNHIST").unwrap_or({ let home = env::var("HOME").unwrap(); - format!("{home}/.fern_history") + format!("{home}/.shed_history") })); let mut entries = read_hist_file(&path)?; // Enforce max_hist limit on loaded entries diff --git a/src/prompt/readline/mod.rs b/src/prompt/readline/mod.rs index 9baad55..285a66b 100644 --- a/src/prompt/readline/mod.rs +++ b/src/prompt/readline/mod.rs @@ -101,7 +101,7 @@ pub enum ReadlineEvent { Pending, } -pub struct FernVi { +pub struct ShedVi { pub reader: PollReader, pub writer: Box, @@ -120,7 +120,7 @@ pub struct FernVi { pub needs_redraw: bool, } -impl FernVi { +impl ShedVi { pub fn new(prompt: Option, tty: RawFd) -> ShResult { let mut new = Self { reader: PollReader::new(), diff --git a/src/prompt/readline/term.rs b/src/prompt/readline/term.rs index 5982c88..f7563d9 100644 --- a/src/prompt/readline/term.rs +++ b/src/prompt/readline/term.rs @@ -23,7 +23,7 @@ use crate::{ sys::TTY_FILENO, }, prompt::readline::keys::{KeyCode, ModKeys}, - shopt::FernBellStyle, + shopt::ShedBellStyle, state::read_shopts, }; use crate::{ diff --git a/src/shopt.rs b/src/shopt.rs index 7d087c6..eee0080 100644 --- a/src/shopt.rs +++ b/src/shopt.rs @@ -6,13 +6,13 @@ use crate::{ }; #[derive(Clone, Copy, Debug)] -pub enum FernBellStyle { +pub enum ShedBellStyle { Audible, Visible, Disable, } -impl FromStr for FernBellStyle { +impl FromStr for ShedBellStyle { type Err = ShErr; fn from_str(s: &str) -> Result { match s.to_ascii_lowercase().as_str() { @@ -28,13 +28,13 @@ impl FromStr for FernBellStyle { } #[derive(Default, Clone, Copy, Debug)] -pub enum FernEditMode { +pub enum ShedEditMode { #[default] Vi, Emacs, } -impl FromStr for FernEditMode { +impl FromStr for ShedEditMode { type Err = ShErr; fn from_str(s: &str) -> Result { match s.to_ascii_lowercase().as_str() { @@ -48,11 +48,11 @@ impl FromStr for FernEditMode { } } -impl Display for FernEditMode { +impl Display for ShedEditMode { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - FernEditMode::Vi => write!(f, "vi"), - FernEditMode::Emacs => write!(f, "emacs"), + ShedEditMode::Vi => write!(f, "vi"), + ShedEditMode::Emacs => write!(f, "emacs"), } } } @@ -277,7 +277,7 @@ impl ShOptCore { } "max_hist" => { let mut output = String::from( - "Maximum number of entries in the command history file (default '.fernhist')\n", + "Maximum number of entries in the command history file (default '.shedhist')\n", ); output.push_str(&format!("{}", self.max_hist)); Ok(Some(output)) @@ -295,7 +295,7 @@ impl ShOptCore { Ok(Some(output)) } "bell_enabled" => { - let mut output = String::from("Whether or not to allow fern to trigger the terminal bell"); + let mut output = String::from("Whether or not to allow shed to trigger the terminal bell"); output.push_str(&format!("{}", self.bell_enabled)); Ok(Some(output)) } @@ -366,7 +366,7 @@ impl Default for ShOptCore { #[derive(Clone, Debug)] pub struct ShOptPrompt { pub trunc_prompt_path: usize, - pub edit_mode: FernEditMode, + pub edit_mode: ShedEditMode, pub comp_limit: usize, pub highlight: bool, pub auto_indent: bool, @@ -386,7 +386,7 @@ impl ShOptPrompt { self.trunc_prompt_path = val; } "edit_mode" => { - let Ok(val) = val.parse::() else { + let Ok(val) = val.parse::() else { return Err(ShErr::simple( ShErrKind::SyntaxErr, "shopt: expected 'vi' or 'emacs' for edit_mode value", @@ -545,7 +545,7 @@ impl Default for ShOptPrompt { fn default() -> Self { ShOptPrompt { trunc_prompt_path: 4, - edit_mode: FernEditMode::Vi, + edit_mode: ShedEditMode::Vi, comp_limit: 100, highlight: true, auto_indent: true, diff --git a/src/state.rs b/src/state.rs index 44e62f2..70bb8b0 100644 --- a/src/state.rs +++ b/src/state.rs @@ -16,7 +16,7 @@ use crate::{ }, parse::{ConjunctNode, NdRule, Node, ParsedSrc}, prelude::*, shopt::ShOpts }; -pub struct Fern { +pub struct Shed { pub jobs: RefCell, pub var_scopes: RefCell, pub meta: RefCell, @@ -24,7 +24,7 @@ pub struct Fern { pub shopts: RefCell, } -impl Fern { +impl Shed { pub fn new() -> Self { Self { jobs: RefCell::new(JobTab::new()), @@ -36,7 +36,7 @@ impl Fern { } } -impl Default for Fern { +impl Default for Shed { fn default() -> Self { Self::new() } @@ -123,7 +123,7 @@ impl ScopeStack { new.scopes.push(VarTab::new()); let shell_name = std::env::args() .next() - .unwrap_or_else(|| "fern".to_string()); + .unwrap_or_else(|| "shed".to_string()); new .global_params .insert(ShellParam::ShellName.to_string(), shell_name); @@ -273,7 +273,7 @@ impl ScopeStack { } thread_local! { - pub static FERN: Fern = Fern::new(); + pub static FERN: Shed = Shed::new(); } /// A shell function @@ -569,8 +569,8 @@ impl VarTab { env::set_var("OLDPWD", pathbuf_to_string(std::env::current_dir())); env::set_var("HOME", home.clone()); env::set_var("SHELL", pathbuf_to_string(std::env::current_exe())); - env::set_var("FERN_HIST", format!("{}/.fernhist", home)); - env::set_var("FERN_RC", format!("{}/.fernrc", home)); + env::set_var("FERN_HIST", format!("{}/.shedhist", home)); + env::set_var("FERN_RC", format!("{}/.shedrc", home)); } } pub fn init_sh_argv(&mut self) { @@ -803,49 +803,49 @@ impl MetaTab { /// Read from the job table pub fn read_jobs T>(f: F) -> T { - FERN.with(|fern| f(&fern.jobs.borrow())) + FERN.with(|shed| f(&shed.jobs.borrow())) } /// Write to the job table pub fn write_jobs T>(f: F) -> T { - FERN.with(|fern| f(&mut fern.jobs.borrow_mut())) + FERN.with(|shed| f(&mut shed.jobs.borrow_mut())) } /// Read from the var scope stack pub fn read_vars T>(f: F) -> T { - FERN.with(|fern| f(&fern.var_scopes.borrow())) + FERN.with(|shed| f(&shed.var_scopes.borrow())) } /// Write to the variable table pub fn write_vars T>(f: F) -> T { - FERN.with(|fern| f(&mut fern.var_scopes.borrow_mut())) + FERN.with(|shed| f(&mut shed.var_scopes.borrow_mut())) } pub fn read_meta T>(f: F) -> T { - FERN.with(|fern| f(&fern.meta.borrow())) + FERN.with(|shed| f(&shed.meta.borrow())) } /// Write to the meta table pub fn write_meta T>(f: F) -> T { - FERN.with(|fern| f(&mut fern.meta.borrow_mut())) + FERN.with(|shed| f(&mut shed.meta.borrow_mut())) } /// Read from the logic table pub fn read_logic T>(f: F) -> T { - FERN.with(|fern| f(&fern.logic.borrow())) + FERN.with(|shed| f(&shed.logic.borrow())) } /// Write to the logic table pub fn write_logic T>(f: F) -> T { - FERN.with(|fern| f(&mut fern.logic.borrow_mut())) + FERN.with(|shed| f(&mut shed.logic.borrow_mut())) } pub fn read_shopts T>(f: F) -> T { - FERN.with(|fern| f(&fern.shopts.borrow())) + FERN.with(|shed| f(&shed.shopts.borrow())) } pub fn write_shopts T>(f: F) -> T { - FERN.with(|fern| f(&mut fern.shopts.borrow_mut())) + FERN.with(|shed| f(&mut shed.shopts.borrow_mut())) } pub fn descend_scope(argv: Option>) { @@ -877,10 +877,10 @@ pub fn source_rc() -> ShResult<()> { PathBuf::from(&path) } else { let home = env::var("HOME").unwrap(); - PathBuf::from(format!("{home}/.fernrc")) + PathBuf::from(format!("{home}/.shedrc")) }; if !path.exists() { - return Err(ShErr::simple(ShErrKind::InternalErr, ".fernrc not found")); + return Err(ShErr::simple(ShErrKind::InternalErr, ".shedrc not found")); } source_file(path) } diff --git a/src/tests/readline.rs b/src/tests/readline.rs index e1a3cd1..d88824e 100644 --- a/src/tests/readline.rs +++ b/src/tests/readline.rs @@ -11,7 +11,7 @@ use crate::{ linebuf::LineBuf, term::{raw_mode, KeyReader, LineWriter}, vimode::{ViInsert, ViMode, ViNormal}, - FernVi, + ShedVi, }, }; @@ -180,11 +180,11 @@ impl LineWriter for TestWriter { } } -// NOTE: FernVi structure has changed significantly and readline() method no +// NOTE: ShedVi structure has changed significantly and readline() method no // longer exists These test helpers are disabled until they can be properly // updated /* -impl FernVi { +impl ShedVi { pub fn new_test(prompt: Option, input: &str, initial: &str) -> Self { Self { reader: Box::new(TestReader::new().with_initial(input.as_bytes())), @@ -200,10 +200,10 @@ impl FernVi { } } -fn fernvi_test(input: &str, initial: &str) -> String { - let mut fernvi = FernVi::new_test(None, input, initial); +fn shedvi_test(input: &str, initial: &str) -> String { + let mut shedvi = ShedVi::new_test(None, input, initial); let raw_mode = raw_mode(); - let line = fernvi.readline().unwrap(); + let line = shedvi.readline().unwrap(); std::mem::drop(raw_mode); line } @@ -642,24 +642,24 @@ fn editor_f_char_from_position_zero() { ); } -// NOTE: These tests disabled because fernvi_test() helper is commented out +// NOTE: These tests disabled because shedvi_test() helper is commented out /* #[test] -fn fernvi_test_simple() { - assert_eq!(fernvi_test("foo bar\x1bbdw\r", ""), "foo ") +fn shedvi_test_simple() { + assert_eq!(shedvi_test("foo bar\x1bbdw\r", ""), "foo ") } #[test] -fn fernvi_test_mode_change() { +fn shedvi_test_mode_change() { assert_eq!( - fernvi_test("foo bar biz buzz\x1bbbb2cwbiz buzz bar\r", ""), + shedvi_test("foo bar biz buzz\x1bbbb2cwbiz buzz bar\r", ""), "foo biz buzz bar buzz" ) } #[test] -fn fernvi_test_lorem_ipsum_1() { - assert_eq!(fernvi_test( +fn shedvi_test_lorem_ipsum_1() { + assert_eq!(shedvi_test( "\x1bwwwwwwww5dWdBdBjjdwjdwbbbcwasdasdasdasd\x1b\r", LOREM_IPSUM), "Lorem ipsum dolor sit amet, incididunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in repin voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nExcepteur asdasdasdasd occaecat cupinon proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nCurabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra." @@ -667,9 +667,9 @@ fn fernvi_test_lorem_ipsum_1() { } #[test] -fn fernvi_test_lorem_ipsum_undo() { +fn shedvi_test_lorem_ipsum_undo() { assert_eq!( - fernvi_test( + shedvi_test( "\x1bwwwwwwwwainserting some characters now...\x1bu\r", LOREM_IPSUM ), @@ -678,8 +678,8 @@ fn fernvi_test_lorem_ipsum_undo() { } #[test] -fn fernvi_test_lorem_ipsum_ctrl_w() { - assert_eq!(fernvi_test( +fn shedvi_test_lorem_ipsum_ctrl_w() { + assert_eq!(shedvi_test( "\x1bj5wiasdasdkjhaksjdhkajshd\x17wordswordswords\x17somemorewords\x17\x1b[D\x1b[D\x17\x1b\r", LOREM_IPSUM), "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\nUt enim ad minim am, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nCurabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra." diff --git a/src/tests/script.rs b/src/tests/script.rs index 88910a2..6ef63a9 100644 --- a/src/tests/script.rs +++ b/src/tests/script.rs @@ -4,25 +4,25 @@ use pretty_assertions::assert_eq; use super::super::*; fn get_script_output(name: &str, args: &[&str]) -> Output { - // Resolve the path to the fern binary. + // Resolve the path to the shed binary. // Do not question me. - let mut fern_path = env::current_exe().expect("Failed to get test executable"); // The path to the test executable - fern_path.pop(); // Hocus pocus - fern_path.pop(); - fern_path.push("fern"); // Abra Kadabra + let mut shed_path = env::current_exe().expect("Failed to get test executable"); // The path to the test executable + shed_path.pop(); // Hocus pocus + shed_path.pop(); + shed_path.push("shed"); // Abra Kadabra - if !fern_path.is_file() { - fern_path.pop(); - fern_path.pop(); - fern_path.push("release"); - fern_path.push("fern"); + if !shed_path.is_file() { + shed_path.pop(); + shed_path.pop(); + shed_path.push("release"); + shed_path.push("shed"); } - if !fern_path.is_file() { + if !shed_path.is_file() { panic!("where the hell is the binary") } - process::Command::new(fern_path) // Alakazam + process::Command::new(shed_path) // Alakazam .arg(name) .args(args) .output()