diff --git a/exercises/practice/robot-simulator/.meta/generator.tpl b/exercises/practice/robot-simulator/.meta/generator.tpl index cea2f157d..adb6516ac 100644 --- a/exercises/practice/robot-simulator/.meta/generator.tpl +++ b/exercises/practice/robot-simulator/.meta/generator.tpl @@ -3,7 +3,7 @@ robot-simulator)) {{#test_cases.create}} -(deftest robot_test_{{idx}} +(deftest ^:robot robot_test_{{idx}} (testing {{context}} (let [molly (robot-simulator/robot {:x {{input.position.x}} :y {{input.position.y}} } {{input.direction}})] (is (= {:bearing {{expected.direction}} :coordinates {:x {{expected.position.x}} :y {{expected.position.y}} }} @@ -11,7 +11,7 @@ {{/test_cases.create}} {{#test_cases.move}} -(deftest simulate_test_{{idx}} +(deftest ^:simulate simulate_test_{{idx}} (testing {{context}} (let [molly (robot-simulator/robot {:x {{input.position.x}} :y {{input.position.y}} } {{input.direction}})] (is (= {:bearing {{expected.direction}} :coordinates {:x {{expected.position.x}} :y {{expected.position.y}} }} diff --git a/exercises/practice/robot-simulator/project.clj b/exercises/practice/robot-simulator/project.clj index 93de6a09b..effede910 100644 --- a/exercises/practice/robot-simulator/project.clj +++ b/exercises/practice/robot-simulator/project.clj @@ -1,4 +1,6 @@ (defproject robot-simulator "0.1.0-SNAPSHOT" :description "robot-simulator exercise." :url "https://github.com/exercism/clojure/tree/main/exercises/practice/robot-simulator" - :dependencies [[org.clojure/clojure "1.12.0"]]) + :dependencies [[org.clojure/clojure "1.12.0"]] + :test-selectors {:robot :robot + :simulate :simulate}) diff --git a/exercises/practice/robot-simulator/test/robot_simulator_test.clj b/exercises/practice/robot-simulator/test/robot_simulator_test.clj index 5f0d08b0f..354684ad7 100644 --- a/exercises/practice/robot-simulator/test/robot_simulator_test.clj +++ b/exercises/practice/robot-simulator/test/robot_simulator_test.clj @@ -2,109 +2,109 @@ (:require [clojure.test :refer [deftest testing is]] robot-simulator)) -(deftest robot_test_1 +(deftest ^:robot robot_test_1 (testing "Create robot ▶ at origin facing north" (let [molly (robot-simulator/robot {:x 0 :y 0} :north)] (is (= {:bearing :north :coordinates {:x 0 :y 0}} molly))))) -(deftest robot_test_2 +(deftest ^:robot robot_test_2 (testing "Create robot ▶ at negative position facing south" (let [molly (robot-simulator/robot {:x -1 :y -1} :south)] (is (= {:bearing :south :coordinates {:x -1 :y -1}} molly))))) -(deftest simulate_test_1 +(deftest ^:simulate simulate_test_1 (testing "Rotating clockwise ▶ changes north to east" (let [molly (robot-simulator/robot {:x 0 :y 0} :north)] (is (= {:bearing :east :coordinates {:x 0 :y 0}} (robot-simulator/simulate "R" molly)))))) -(deftest simulate_test_2 +(deftest ^:simulate simulate_test_2 (testing "Rotating clockwise ▶ changes east to south" (let [molly (robot-simulator/robot {:x 0 :y 0} :east)] (is (= {:bearing :south :coordinates {:x 0 :y 0}} (robot-simulator/simulate "R" molly)))))) -(deftest simulate_test_3 +(deftest ^:simulate simulate_test_3 (testing "Rotating clockwise ▶ changes south to west" (let [molly (robot-simulator/robot {:x 0 :y 0} :south)] (is (= {:bearing :west :coordinates {:x 0 :y 0}} (robot-simulator/simulate "R" molly)))))) -(deftest simulate_test_4 +(deftest ^:simulate simulate_test_4 (testing "Rotating clockwise ▶ changes west to north" (let [molly (robot-simulator/robot {:x 0 :y 0} :west)] (is (= {:bearing :north :coordinates {:x 0 :y 0}} (robot-simulator/simulate "R" molly)))))) -(deftest simulate_test_5 +(deftest ^:simulate simulate_test_5 (testing "Rotating counter-clockwise ▶ changes north to west" (let [molly (robot-simulator/robot {:x 0 :y 0} :north)] (is (= {:bearing :west :coordinates {:x 0 :y 0}} (robot-simulator/simulate "L" molly)))))) -(deftest simulate_test_6 +(deftest ^:simulate simulate_test_6 (testing "Rotating counter-clockwise ▶ changes west to south" (let [molly (robot-simulator/robot {:x 0 :y 0} :west)] (is (= {:bearing :south :coordinates {:x 0 :y 0}} (robot-simulator/simulate "L" molly)))))) -(deftest simulate_test_7 +(deftest ^:simulate simulate_test_7 (testing "Rotating counter-clockwise ▶ changes south to east" (let [molly (robot-simulator/robot {:x 0 :y 0} :south)] (is (= {:bearing :east :coordinates {:x 0 :y 0}} (robot-simulator/simulate "L" molly)))))) -(deftest simulate_test_8 +(deftest ^:simulate simulate_test_8 (testing "Rotating counter-clockwise ▶ changes east to north" (let [molly (robot-simulator/robot {:x 0 :y 0} :east)] (is (= {:bearing :north :coordinates {:x 0 :y 0}} (robot-simulator/simulate "L" molly)))))) -(deftest simulate_test_9 +(deftest ^:simulate simulate_test_9 (testing "Moving forward one ▶ facing north increments Y" (let [molly (robot-simulator/robot {:x 0 :y 0} :north)] (is (= {:bearing :north :coordinates {:x 0 :y 1}} (robot-simulator/simulate "A" molly)))))) -(deftest simulate_test_10 +(deftest ^:simulate simulate_test_10 (testing "Moving forward one ▶ facing south decrements Y" (let [molly (robot-simulator/robot {:x 0 :y 0} :south)] (is (= {:bearing :south :coordinates {:x 0 :y -1}} (robot-simulator/simulate "A" molly)))))) -(deftest simulate_test_11 +(deftest ^:simulate simulate_test_11 (testing "Moving forward one ▶ facing east increments X" (let [molly (robot-simulator/robot {:x 0 :y 0} :east)] (is (= {:bearing :east :coordinates {:x 1 :y 0}} (robot-simulator/simulate "A" molly)))))) -(deftest simulate_test_12 +(deftest ^:simulate simulate_test_12 (testing "Moving forward one ▶ facing west decrements X" (let [molly (robot-simulator/robot {:x 0 :y 0} :west)] (is (= {:bearing :west :coordinates {:x -1 :y 0}} (robot-simulator/simulate "A" molly)))))) -(deftest simulate_test_13 +(deftest ^:simulate simulate_test_13 (testing "Follow series of instructions ▶ moving east and north from README" (let [molly (robot-simulator/robot {:x 7 :y 3} :north)] (is (= {:bearing :west :coordinates {:x 9 :y 4}} (robot-simulator/simulate "RAALAL" molly)))))) -(deftest simulate_test_14 +(deftest ^:simulate simulate_test_14 (testing "Follow series of instructions ▶ moving west and north" (let [molly (robot-simulator/robot {:x 0 :y 0} :north)] (is (= {:bearing :west :coordinates {:x -4 :y 1}} (robot-simulator/simulate "LAAARALA" molly)))))) -(deftest simulate_test_15 +(deftest ^:simulate simulate_test_15 (testing "Follow series of instructions ▶ moving west and south" (let [molly (robot-simulator/robot {:x 2 :y -7} :east)] (is (= {:bearing :south :coordinates {:x -3 :y -8}} (robot-simulator/simulate "RRAAAAALA" molly)))))) -(deftest simulate_test_16 +(deftest ^:simulate simulate_test_16 (testing "Follow series of instructions ▶ moving east and north" (let [molly (robot-simulator/robot {:x 8 :y 4} :south)] (is (= {:bearing :north :coordinates {:x 11 :y 5}}