From cf237509c3cae3cbbde2ebc553e8b422d01e2b37 Mon Sep 17 00:00:00 2001 From: fdai7374 Date: Sat, 4 Feb 2023 18:44:48 +0100 Subject: [PATCH] refactoring: sort rick command in mod.rs --- src/builtins/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/builtins/mod.rs b/src/builtins/mod.rs index 4e26dc5..f371bb1 100644 --- a/src/builtins/mod.rs +++ b/src/builtins/mod.rs @@ -13,10 +13,10 @@ mod ls; mod open; mod pwd; mod quote; +mod rick; mod segfault; mod sus; mod time; -mod rick; @@ -49,10 +49,10 @@ const BUILTINS: Lazy)>> = Lazy::new(|| { ("open", Box::new(open::Open)), ("pwd", Box::new(pwd::Pwd)), ("quote", Box::new(quote::Quote)), + ("rick", Box::new(rick::Rick)), ("segfault", Box::new(segfault::Segfault)), ("sus", Box::new(sus::Sus)), ("time", Box::new(time::Time)), - ("rick", Box::new(rick::Rick)), ] }); @@ -135,6 +135,11 @@ mod tests { assert!(is_builtin("quote")); } + #[test] + fn test_is_builtin_rick(){ + assert!(is_builtin("rick")); +} + #[test] fn test_is_builtin_segfault() { assert!(is_builtin("segfault")); @@ -155,7 +160,3 @@ mod tests { assert!(!is_builtin("notabuiltin")) } - #[test] - fn test_is_builtin_rick(){ - assert!(is_builtin("rick")); - }