test.rs 669 B

12345678910111213141516171819202122232425262728293031
  1. use ion_shell::{builtins::Status, types, Shell};
  2. #[builtins_proc::builtin(
  3. desc = "prints 42 to the screen",
  4. man = "
  5. SYNOPSIS
  6. gimme_the_answer_to_life_to_the_universe_and_to_everything_else [-h | --help]
  7. DESCRIPTION
  8. Who doesn't want 42 printed to screen?
  9. "
  10. )]
  11. fn gimme_the_answer_to_life_to_the_universe_and_to_everything_else(
  12. args: &[types::Str],
  13. _shell: &mut Shell<'_>,
  14. ) -> Status {
  15. println!("42");
  16. Status::SUCCESS
  17. }
  18. #[test]
  19. fn works() {
  20. assert_eq!(
  21. builtin_gimme_the_answer_to_life_to_the_universe_and_to_everything_else(
  22. &[],
  23. &mut Shell::default()
  24. ),
  25. Status::SUCCESS
  26. );
  27. }