Browse Source

refactoring: sort rick command in mod.rs

main
fdai7374 2 years ago
committed by fdai7451
parent
commit
cf237509c3
  1. 13
      src/builtins/mod.rs

13
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<Vec<(&str, Box<dyn Builtin>)>> = 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"));
}
Loading…
Cancel
Save