This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cljs.test with consistent alias (#162)
* Use cljs.test with consistent alias * Throw JS error instead of Java exception
- Loading branch information
Showing
44 changed files
with
167 additions
and
170 deletions.
There are no files selected for viewing
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/collatz-conjecture/test/collatz_conjecture_test.cljs
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/complex-numbers/test/complex_numbers_test.cljs
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
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
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/difference-of-squares/test/difference_of_squares_test.cljs
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
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/kindergarten-garden/test/kindergarten_garden_test.cljs
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
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
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
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/perfect-numbers/test/perfect_numbers_test.cljs
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/protein-translation/test/protein_translation_test.cljs
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
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
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
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 robot-name-test | ||
(:require [clojure.test :refer [deftest is testing]] | ||
(:require [cljs.test :refer [deftest is] :as t :include-macros true] | ||
robot-name)) | ||
|
||
(deftest robot-name | ||
(let [a-robot (robot-name/robot) | ||
its-name (robot-name/robot-name a-robot)] | ||
(is (re-seq #"[A-Z]{2}\d{3}" its-name)))) | ||
(is (re-seq #"[A-Z]{2}\d{3}" its-name)))) | ||
|
||
(deftest name-matches-pattern | ||
(let [a-robot (robot-name/robot) | ||
its-name (robot-name/robot-name a-robot)] | ||
(is (= its-name (robot-name/robot-name a-robot))))) | ||
(let [a-robot (robot-name/robot) | ||
its-name (robot-name/robot-name a-robot)] | ||
(is (= its-name (robot-name/robot-name a-robot))))) | ||
|
||
(deftest different-robots-different-names | ||
(let [a-robot (robot-name/robot) | ||
(let [a-robot (robot-name/robot) | ||
its-name (robot-name/robot-name a-robot)] | ||
(is (not= its-name (-> (robot-name/robot) robot-name/robot-name))))) | ||
(is (not= its-name (-> (robot-name/robot) robot-name/robot-name))))) | ||
|
||
(deftest new-name-matches | ||
(let [a-robot (robot-name/robot) | ||
its-original-name (robot-name/robot-name a-robot) | ||
its-new-name (do (robot-name/reset-name a-robot) | ||
(robot-name/robot-name a-robot))] | ||
(is (re-seq #"[A-Z]{2}\d{3}" its-new-name)))) | ||
(is (re-seq #"[A-Z]{2}\d{3}" its-new-name)))) | ||
|
||
(deftest new-name-different | ||
(let [a-robot (robot-name/robot) | ||
its-original-name (robot-name/robot-name a-robot) | ||
its-new-name (do (robot-name/reset-name a-robot) | ||
(robot-name/robot-name a-robot))] | ||
(is (not= its-original-name its-new-name)))) | ||
(is (not= its-original-name its-new-name)))) | ||
|
||
(deftest new-name-does-not-change-until-reset | ||
(let [a-robot (robot-name/robot) | ||
its-original-name (robot-name/robot-name a-robot) | ||
its-new-name (do (robot-name/reset-name a-robot) | ||
(robot-name/robot-name a-robot))] | ||
(is (= its-new-name (robot-name/robot-name a-robot))))) | ||
(is (= its-new-name (robot-name/robot-name a-robot))))) | ||
|
||
(deftest new-names-different-each-time | ||
(let [a-robot (robot-name/robot) | ||
its-original-name (robot-name/robot-name a-robot) | ||
its-new-name (do (robot-name/reset-name a-robot) | ||
(robot-name/robot-name a-robot))] | ||
(is (not= its-new-name (do (robot-name/reset-name a-robot) | ||
(robot-name/robot-name a-robot)))))) | ||
(is (not= its-new-name (do (robot-name/reset-name a-robot) | ||
(robot-name/robot-name a-robot)))))) |
2 changes: 1 addition & 1 deletion
2
exercises/practice/robot-simulator/test/robot_simulator_test.cljs
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/roman-numerals/test/roman_numerals_test.cljs
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/rotational-cipher/test/rotational_cipher_test.cljs
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
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
2 changes: 1 addition & 1 deletion
2
exercises/practice/scrabble-score/test/scrabble_score_test.cljs
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
Oops, something went wrong.