-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d59e88
commit 3aa080a
Showing
49 changed files
with
557 additions
and
557 deletions.
There are no files selected for viewing
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
tests/example-all-fail/project.clj → tests/all-fail/project.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) |
16 changes: 8 additions & 8 deletions
16
tests/example-all-fail/src/leap.clj → tests/all-fail/src/leap.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
(ns leap) | ||
|
||
(defn leap-year? [year] | ||
(let [[p c s] (map #(= 0 (rem year %1)) [4 100 400])] | ||
(not | ||
(or (and p (not c)) | ||
(and c s))))) | ||
|
||
(ns leap) | ||
|
||
(defn leap-year? [year] | ||
(let [[p c s] (map #(= 0 (rem year %1)) [4 100 400])] | ||
(not | ||
(or (and p (not c)) | ||
(and c s))))) | ||
|
60 changes: 30 additions & 30 deletions
60
tests/example-empty-file/test/leap_test.clj → tests/all-fail/test/leap_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
(ns leap-test | ||
(:require [clojure.test :refer [deftest is]] | ||
leap)) | ||
|
||
(deftest year-not-divisible-by-4 | ||
(is (not (leap/leap-year? 2015)))) | ||
|
||
(deftest year-divisible-by-2-but-not-4 | ||
(is (not (leap/leap-year? 1970)))) | ||
|
||
(deftest year-divisible-by-4-but-not-100 | ||
(is (leap/leap-year? 1996))) | ||
|
||
(deftest year-divisible-by-4-and-5 | ||
(is (leap/leap-year? 1960))) | ||
|
||
(deftest year-divisible-by-100-but-not-400 | ||
(is (not (leap/leap-year? 2100)))) | ||
|
||
(deftest year-divisible-by-100-but-not-by-3 | ||
(is (not (leap/leap-year? 1900)))) | ||
|
||
(deftest year-divisible-by-400 | ||
(is (leap/leap-year? 2000))) | ||
|
||
(deftest year-divisible-by-400-but-not-125 | ||
(is (leap/leap-year? 2400))) | ||
|
||
(deftest year-divisible-by-200-but-not-by-400 | ||
(is (not (leap/leap-year? 1800)))) | ||
(ns leap-test | ||
(:require [clojure.test :refer [deftest is]] | ||
leap)) | ||
|
||
(deftest year-not-divisible-by-4 | ||
(is (not (leap/leap-year? 2015)))) | ||
|
||
(deftest year-divisible-by-2-but-not-4 | ||
(is (not (leap/leap-year? 1970)))) | ||
|
||
(deftest year-divisible-by-4-but-not-100 | ||
(is (leap/leap-year? 1996))) | ||
|
||
(deftest year-divisible-by-4-and-5 | ||
(is (leap/leap-year? 1960))) | ||
|
||
(deftest year-divisible-by-100-but-not-400 | ||
(is (not (leap/leap-year? 2100)))) | ||
|
||
(deftest year-divisible-by-100-but-not-by-3 | ||
(is (not (leap/leap-year? 1900)))) | ||
|
||
(deftest year-divisible-by-400 | ||
(is (leap/leap-year? 2000))) | ||
|
||
(deftest year-divisible-by-400-but-not-125 | ||
(is (leap/leap-year? 2400))) | ||
|
||
(deftest year-divisible-by-200-but-not-by-400 | ||
(is (not (leap/leap-year? 1800)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"version": 3, | ||
"status": "error", | ||
"message": "----- Error --------------------------------------------------------------------\nType: clojure.lang.ExceptionInfo\nMessage: Could not resolve symbol: leap/leap-year?\nData: {:type :sci/error, :line 5, :column 1, :file \"/opt/test-runner/tests/empty-file/test/leap_test.clj\", :phase \"analysis\"}\nLocation: /opt/test-runner/tests/empty-file/test/leap_test.clj:6:12\nPhase: analysis\n\n----- Context ------------------------------------------------------------------\n 2: (:require [clojure.test :refer [deftest is]]\n 3: leap))\n 4: \n 5: (deftest year-not-divisible-by-4\n 6: (is (not (leap/leap-year? 2015))))\n ^--- Could not resolve symbol: leap/leap-year?\n 7: \n 8: (deftest year-divisible-by-2-but-not-4\n 9: (is (not (leap/leap-year? 1970))))\n10: \n11: (deftest year-divisible-by-4-but-not-100\n\n----- Stack trace --------------------------------------------------------------\nleap-test - /opt/test-runner/tests/empty-file/test/leap_test.clj:6:12\nclojure.core/list - <built-in>\nclojure.core/let - <built-in>\nleap-test - /opt/test-runner/tests/empty-file/test/leap_test.clj:6:3\nleap-test/is - /opt/test-runner/tests/empty-file/test/leap_test.clj:6:3\n... (run with --debug to see elided elements)\nclojure.core/fn - <built-in>\nleap-test - /opt/test-runner/tests/empty-file/test/leap_test.clj:5:1\nleap-test - /opt/test-runner/tests/empty-file/test/leap_test.clj:5:1\nleap-test - /opt/test-runner/tests/empty-file/test/leap_test.clj:5:1\nuser - /opt/test-runner/./test-runner.clj:19:1" | ||
} |
8 changes: 4 additions & 4 deletions
8
tests/example-empty-file/project.clj → tests/empty-file/project.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) |
File renamed without changes.
60 changes: 30 additions & 30 deletions
60
tests/example-spec/test/leap_test.clj → tests/empty-file/test/leap_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
(ns leap-test | ||
(:require [clojure.test :refer [deftest is]] | ||
leap)) | ||
|
||
(deftest year-not-divisible-by-4 | ||
(is (not (leap/leap-year? 2015)))) | ||
|
||
(deftest year-divisible-by-2-but-not-4 | ||
(is (not (leap/leap-year? 1970)))) | ||
|
||
(deftest year-divisible-by-4-but-not-100 | ||
(is (leap/leap-year? 1996))) | ||
|
||
(deftest year-divisible-by-4-and-5 | ||
(is (leap/leap-year? 1960))) | ||
|
||
(deftest year-divisible-by-100-but-not-400 | ||
(is (not (leap/leap-year? 2100)))) | ||
|
||
(deftest year-divisible-by-100-but-not-by-3 | ||
(is (not (leap/leap-year? 1900)))) | ||
|
||
(deftest year-divisible-by-400 | ||
(is (leap/leap-year? 2000))) | ||
|
||
(deftest year-divisible-by-400-but-not-125 | ||
(is (leap/leap-year? 2400))) | ||
|
||
(deftest year-divisible-by-200-but-not-by-400 | ||
(is (not (leap/leap-year? 1800)))) | ||
(ns leap-test | ||
(:require [clojure.test :refer [deftest is]] | ||
leap)) | ||
|
||
(deftest year-not-divisible-by-4 | ||
(is (not (leap/leap-year? 2015)))) | ||
|
||
(deftest year-divisible-by-2-but-not-4 | ||
(is (not (leap/leap-year? 1970)))) | ||
|
||
(deftest year-divisible-by-4-but-not-100 | ||
(is (leap/leap-year? 1996))) | ||
|
||
(deftest year-divisible-by-4-and-5 | ||
(is (leap/leap-year? 1960))) | ||
|
||
(deftest year-divisible-by-100-but-not-400 | ||
(is (not (leap/leap-year? 2100)))) | ||
|
||
(deftest year-divisible-by-100-but-not-by-3 | ||
(is (not (leap/leap-year? 1900)))) | ||
|
||
(deftest year-divisible-by-400 | ||
(is (leap/leap-year? 2000))) | ||
|
||
(deftest year-divisible-by-400-but-not-125 | ||
(is (leap/leap-year? 2400))) | ||
|
||
(deftest year-divisible-by-200-but-not-by-400 | ||
(is (not (leap/leap-year? 1800)))) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...mple-flat-multiple-assertions/project.clj → tests/flat-multiple-assertions/project.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) |
16 changes: 8 additions & 8 deletions
16
...ple-flat-multiple-assertions/src/leap.clj → tests/flat-multiple-assertions/src/leap.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
(ns leap) | ||
|
||
(defn leap-year? [year] | ||
(assert (not= year 1996)) ;; throws AssertionError | ||
(when (= year 1960) (case :foo)) ;; throws IllegalArgumentException | ||
(let [[p c s] (map #(= 0 (rem year %1)) [4 100 401])] | ||
(or (and p (not c)) | ||
(and c s)))) | ||
(ns leap) | ||
|
||
(defn leap-year? [year] | ||
(assert (not= year 1996)) ;; throws AssertionError | ||
(when (= year 1960) (case :foo)) ;; throws IllegalArgumentException | ||
(let [[p c s] (map #(= 0 (rem year %1)) [4 100 401])] | ||
(or (and p (not c)) | ||
(and c s)))) |
94 changes: 47 additions & 47 deletions
94
...at-multiple-assertions/test/leap_test.clj → ...at-multiple-assertions/test/leap_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
(ns leap-test | ||
(:require [clojure.test :refer [deftest is]] | ||
leap)) | ||
|
||
(deftest pass-fail-error | ||
(is (= true true) :1) | ||
(is (= true false) :2) | ||
(is (assert false) :3)) | ||
|
||
(deftest fail-error-pass | ||
(is (= true false) :1) | ||
(is (assert false) :2) | ||
(is (= true true) :3)) | ||
|
||
(deftest error-pass-fail | ||
(is (assert false) :1) | ||
(is (= true true) :2) | ||
(is (= true false) :3)) | ||
|
||
(deftest pass-fail-pass | ||
(is (= true true) :1) | ||
(is (= true false) :2) | ||
(is (= true true) :3)) | ||
|
||
(deftest pass-pass-pass | ||
(is (= true true) :1) | ||
(is (= true true) :2) | ||
(is (= true true) :3)) | ||
|
||
(deftest error-pass-error | ||
(is (assert false) :1) | ||
(is true :2) | ||
(is (assert false) :3)) | ||
|
||
(deftest pass-error-pass-error | ||
(is (not (leap/leap-year? 1900))) | ||
(is (leap/leap-year? 1960)) | ||
(is (not (leap/leap-year? 1970))) | ||
(is (leap/leap-year? 1996))) | ||
|
||
(deftest fail-pass | ||
(is (leap/leap-year? 2000)) | ||
(is (not (leap/leap-year? 2015)))) | ||
|
||
(deftest pass-pass | ||
(is (not (leap/leap-year? 2100))) | ||
(is (not (leap/leap-year? 1800)))) | ||
(ns leap-test | ||
(:require [clojure.test :refer [deftest is]] | ||
leap)) | ||
|
||
(deftest pass-fail-error | ||
(is (= true true) :1) | ||
(is (= true false) :2) | ||
(is (assert false) :3)) | ||
|
||
(deftest fail-error-pass | ||
(is (= true false) :1) | ||
(is (assert false) :2) | ||
(is (= true true) :3)) | ||
|
||
(deftest error-pass-fail | ||
(is (assert false) :1) | ||
(is (= true true) :2) | ||
(is (= true false) :3)) | ||
|
||
(deftest pass-fail-pass | ||
(is (= true true) :1) | ||
(is (= true false) :2) | ||
(is (= true true) :3)) | ||
|
||
(deftest pass-pass-pass | ||
(is (= true true) :1) | ||
(is (= true true) :2) | ||
(is (= true true) :3)) | ||
|
||
(deftest error-pass-error | ||
(is (assert false) :1) | ||
(is true :2) | ||
(is (assert false) :3)) | ||
|
||
(deftest pass-error-pass-error | ||
(is (not (leap/leap-year? 1900))) | ||
(is (leap/leap-year? 1960)) | ||
(is (not (leap/leap-year? 1970))) | ||
(is (leap/leap-year? 1996))) | ||
|
||
(deftest fail-pass | ||
(is (leap/leap-year? 2000)) | ||
(is (not (leap/leap-year? 2015)))) | ||
|
||
(deftest pass-pass | ||
(is (not (leap/leap-year? 2100))) | ||
(is (not (leap/leap-year? 1800)))) |
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...le-nested-multiple-assertions/project.clj → tests/nested-multiple-assertions/project.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) | ||
(defproject leap "0.1.0-SNAPSHOT" | ||
:description "leap exercise." | ||
:url "https://github.com/exercism/clojure/tree/master/exercises/leap" | ||
:dependencies [[org.clojure/clojure "1.10.0"]]) |
6 changes: 3 additions & 3 deletions
6
...e-nested-multiple-assertions/src/leap.clj → ...s/nested-multiple-assertions/src/leap.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(ns leap) | ||
|
||
(defn leap-year? [year]) | ||
(ns leap) | ||
|
||
(defn leap-year? [year]) |
Oops, something went wrong.