summary refs log tree commit diff stats
path: root/emacs-lisp/leap/leap-test.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs-lisp/leap/leap-test.el')
-rw-r--r--emacs-lisp/leap/leap-test.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/emacs-lisp/leap/leap-test.el b/emacs-lisp/leap/leap-test.el
new file mode 100644
index 0000000..f6cb597
--- /dev/null
+++ b/emacs-lisp/leap/leap-test.el
@@ -0,0 +1,24 @@
+;;; leap-test.el --- Tests for Leap exercise (exercism)
+
+;;; Commentary:
+
+;;; Code:
+(load-file "leap.el")
+
+(ert-deftest vanilla-leap-year ()
+  (should (leap-year-p 1996)))
+
+(ert-deftest any-old-year ()
+  (should-not (leap-year-p 1997)))
+
+(ert-deftest non-leap-even-year ()
+  (should-not (leap-year-p 1997)))
+
+(ert-deftest century ()
+  (should-not (leap-year-p 1900)))
+
+(ert-deftest exceptional-century ()
+  (should (leap-year-p 2000)))
+
+(provide 'leap-test)
+;;; leap-test.el ends here