Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

task3.rs 761B

123456789101112131415161718192021222324252627282930313233
  1. extern crate task3;
  2. #[test]
  3. fn test_one_char() {
  4. assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'T'),
  5. 1);
  6. }
  7. #[test]
  8. fn test_two_char() {
  9. assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥",
  10. '♥'),
  11. 2);
  12. }
  13. #[test]
  14. #[should_panic]
  15. fn test_wrong() {
  16. assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'c'),
  17. 2);
  18. }
  19. #[test]
  20. fn test_four_char() {
  21. assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", 'o'),
  22. 4);
  23. }
  24. #[test]
  25. fn test_no_char() {
  26. assert_eq!(task3::count("♥ The quick brown fox jumps over the lazy dog. ♥", '!'),
  27. 0);
  28. }