Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify directory structure #60

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]])
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)))))

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))))
5 changes: 5 additions & 0 deletions tests/empty-file/expected_results.json
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"
}
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.
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))))
5 changes: 0 additions & 5 deletions tests/example-empty-file/expected_results.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/example-partial-fail/project.clj

This file was deleted.

4 changes: 0 additions & 4 deletions tests/example-runtime-error/project.clj

This file was deleted.

4 changes: 0 additions & 4 deletions tests/example-spec/project.clj

This file was deleted.

4 changes: 0 additions & 4 deletions tests/example-success/project.clj

This file was deleted.

30 changes: 0 additions & 30 deletions tests/example-success/test/leap_test.clj

This file was deleted.

5 changes: 0 additions & 5 deletions tests/example-syntax-error/expected_results.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/example-syntax-error/project.clj

This file was deleted.

30 changes: 0 additions & 30 deletions tests/example-syntax-error/test/leap_test.clj

This file was deleted.

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"]])
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))))
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))))
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"]])
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])
Loading