From f4d080fd2ae4df1cbb191d45b5c45a3b80bb3b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=20Nagy?= <20251272+BNAndras@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:39:26 -0700 Subject: [PATCH] Sync raindrops tests (#354) * Sync raindrops tests * Revert result vs expected order * Format stub --- .../practice/raindrops/raindrops-test.el | 104 ++++++++++-------- exercises/practice/raindrops/raindrops.el | 8 +- 2 files changed, 64 insertions(+), 48 deletions(-) diff --git a/exercises/practice/raindrops/raindrops-test.el b/exercises/practice/raindrops/raindrops-test.el index b04c71aa..6fb0ccc7 100644 --- a/exercises/practice/raindrops/raindrops-test.el +++ b/exercises/practice/raindrops/raindrops-test.el @@ -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 diff --git a/exercises/practice/raindrops/raindrops.el b/exercises/practice/raindrops/raindrops.el index a8a4e179..73c97951 100644 --- a/exercises/practice/raindrops/raindrops.el +++ b/exercises/practice/raindrops/raindrops.el @@ -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