Browse Source

refactoring: sort rick command in mod.rs

main
fdai7374 2 years ago
parent
commit
0ad944d465
  1. 13
      src/builtins/mod.rs

13
src/builtins/mod.rs

@ -13,10 +13,10 @@ mod ls;
mod open; mod open;
mod pwd; mod pwd;
mod quote; mod quote;
mod rick;
mod segfault; mod segfault;
mod sus; mod sus;
mod time; mod time;
mod rick;
@ -49,10 +49,10 @@ const BUILTINS: Lazy<Vec<(&str, Box<dyn Builtin>)>> = Lazy::new(|| {
("open", Box::new(open::Open)), ("open", Box::new(open::Open)),
("pwd", Box::new(pwd::Pwd)), ("pwd", Box::new(pwd::Pwd)),
("quote", Box::new(quote::Quote)), ("quote", Box::new(quote::Quote)),
("rick", Box::new(rick::Rick)),
("segfault", Box::new(segfault::Segfault)), ("segfault", Box::new(segfault::Segfault)),
("sus", Box::new(sus::Sus)), ("sus", Box::new(sus::Sus)),
("time", Box::new(time::Time)), ("time", Box::new(time::Time)),
("rick", Box::new(rick::Rick)),
] ]
}); });
@ -135,6 +135,11 @@ mod tests {
assert!(is_builtin("quote")); assert!(is_builtin("quote"));
} }
#[test]
fn test_is_builtin_rick(){
assert!(is_builtin("rick"));
}
#[test] #[test]
fn test_is_builtin_segfault() { fn test_is_builtin_segfault() {
assert!(is_builtin("segfault")); assert!(is_builtin("segfault"));
@ -155,7 +160,3 @@ mod tests {
assert!(!is_builtin("notabuiltin")) assert!(!is_builtin("notabuiltin"))
} }
#[test]
fn test_is_builtin_rick(){
assert!(is_builtin("rick"));
}
Loading…
Cancel
Save