Skip to content

Commit

Permalink
Sync raindrops tests (#354)
Browse files Browse the repository at this point in the history
* Sync raindrops tests

* Revert result vs expected order

* Format stub
  • Loading branch information
BNAndras authored Apr 24, 2024
1 parent 32c274c commit f4d080f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 48 deletions.
104 changes: 59 additions & 45 deletions exercises/practice/raindrops/raindrops-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,82 @@

;;; Code:


(load-file "raindrops.el")
(declare-function convert "raindrops.el" (n))

(ert-deftest test-1 ()
(should (equal "1"
(convert 1))))

(ert-deftest test-3 ()
(should (equal "Pling"
(convert 3))))
(ert-deftest the-sound-for-1-is-1 ()
(should (string= (convert 1) "1")))


(ert-deftest the-sound-for-3-is-Pling ()
(should (string= (convert 3) "Pling")))


(ert-deftest the-sound-for-5-is-Plang ()
(should (string= (convert 5) "Plang")))


(ert-deftest the-sound-for-7-is-Plong ()
(should (string= (convert 7) "Plong")))


(ert-deftest the-sound-for-6-is-Pling ()
(should (string= (convert 6) "Pling" )))


(ert-deftest the-sound-for-8-is-8 ()
(should (string= (convert 8) "8")))


(ert-deftest the-sound-for-9-is-Pling ()
(should (string= (convert 9) "Pling" )))


(ert-deftest the-sound-for-10-is-Plang ()
(should (string= (convert 10) "Plang")))


(ert-deftest the-sound-for-14-is-Plong ()
(should (string= (convert 14) "Plong")))


(ert-deftest the-sound-for-15-is-PlingPlong ()
(should (string= (convert 15) "PlingPlang")))


(ert-deftest the-sound-for-21-is-PlingPlong ()
(should (string= (convert 21) "PlingPlong")))


(ert-deftest the-sound-for-25-is-Plang ()
(should (string= (convert 25) "Plang")))

(ert-deftest test-5 ()
(should (equal "Plang"
(convert 5))))

(ert-deftest test-7 ()
(should (equal "Plong"
(convert 7))))
(ert-deftest the-sound-for-27-is-Pling ()
(should (string= (convert 27) "Pling")))

(ert-deftest test-6 ()
(should (equal "Pling"
(convert 6))))

(ert-deftest test-9 ()
(should (equal "Pling"
(convert 9))))
(ert-deftest the-sound-for-35-is-PlangPlong ()
(should (string= (convert 35) "PlangPlong")))

(ert-deftest test-10 ()
(should (equal "Plang"
(convert 10))))

(ert-deftest test-15 ()
(should (equal "PlingPlang"
(convert 15))))
(ert-deftest the-sound-for-49-is-Plong ()
(should (string= (convert 49) "Plong")))

(ert-deftest test-21 ()
(should (equal "PlingPlong"
(convert 21))))

(ert-deftest test-25 ()
(should (equal "Plang"
(convert 25))))
(ert-deftest the-sound-for-52-is-52 ()
(should (string= (convert 52) "52")))

(ert-deftest test-35 ()
(should (equal "PlangPlong"
(convert 35))))

(ert-deftest test-49 ()
(should (equal "Plong"
(convert 49))))
(ert-deftest the-sound-for-105-is-PlingPlangPlong ()
(should (string= (convert 105) "PlingPlangPlong")))

(ert-deftest test-52 ()
(should (equal "52"
(convert 52))))

(ert-deftest test-105 ()
(should (equal "PlingPlangPlong"
(convert 105))))
(ert-deftest the-sound-for-3125-is-Plang ()
(should (string= (convert 3125) "Plang")))

(ert-deftest test-12121 ()
(should (equal "12121"
(convert 12121))))

(provide 'raindrops-test)
;;; raindrops-test.el ends here
8 changes: 5 additions & 3 deletions exercises/practice/raindrops/raindrops.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

;;; Commentary:

(defun convert (n)
"Convert integer N to its raindrops string."
;;; Code:
)


(defun convert (n)
(error "Delete this S-Expression and write your own implementation"))


(provide 'raindrops)
;;; raindrops.el ends here

0 comments on commit f4d080f

Please sign in to comment.