No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. }