Skip to content

Commit

Permalink
tests simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
iGEL committed Dec 17, 2023
1 parent f47b7fe commit d80ea2b
Showing 1 changed file with 33 additions and 112 deletions.
145 changes: 33 additions & 112 deletions test/signals/ks_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
:system :ks})
ks/lights))))

(testing "with speed limit (no Zs3v)"
(testing "with speed limit (no Zs3)"
(testing "distant shows Ks1"
(is (= {:top-white nil
:red nil
Expand Down Expand Up @@ -348,7 +348,7 @@
ks/lights)))))

(testing "with speed limit"
(testing "without zs3v"
(testing "without zs3"
(testing "distant shows ks1"
(is (= {:top-white :off
:red nil
Expand Down Expand Up @@ -378,7 +378,7 @@
:system :ks})
ks/lights)))))

(testing "with zs3v"
(testing "with zs3"
(testing "distant shows ks1 (blinking) and top white"
(is (= {:top-white :on
:red nil
Expand Down Expand Up @@ -410,7 +410,7 @@
:system :ks})
ks/lights)))))

(testing "with zs3v but no speed limit"
(testing "with zs3 but no speed limit"
(testing "distant shows ks1"
(is (= {:top-white :off
:red nil
Expand Down Expand Up @@ -639,113 +639,6 @@
ks/lights))))))

(testing "zs3"
(testing "stop"
(testing "combination shows hp0"
(is (= {:top-white nil
:red :on
:green :off
:yellow :off
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/combination {:distant {:aspect :stop}
:main {:aspect :stop
:speed-limit 10
:zs3 :sign}
:system :ks})
ks/lights))))

(testing "main shows hp0"
(is (= {:top-white nil
:red :on
:green :off
:yellow nil
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/main {:aspect :stop
:zs3 :sign
:speed-limit 10
:system :ks})
ks/lights)))))

(testing "proceed"
(testing "with speed limit"
(testing "combination"
(testing "with stop expected shows ks2"
(is (= {:top-white nil
:red :off
:green :off
:yellow :on
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/combination {:distant {:aspect :stop}
:main {:aspect :proceed
:zs3 :sign
:speed-limit 10}
:system :ks})
ks/lights))))

(testing "with stop and speed limit expected shows ks2"
(is (= {:top-white nil
:red :off
:green :off
:yellow :on
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/combination {:distant {:aspect :stop
:zs3 :sign
:speed-limit 10}
:main {:aspect :proceed}
:system :ks})
ks/lights))))

(testing "with proceed expected shows ks1"
(is (= {:top-white nil
:red :off
:green :on
:yellow :off
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/combination {:distant {:aspect :proceed}
:main {:aspect :proceed
:zs3 :display
:speed-limit 10}
:system :ks})
ks/lights))))

(testing "with proceed and speed-limit expected shows ks1"
(is (= {:top-white nil
:red :off
:green :on
:yellow :off
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/combination {:distant {:aspect :proceed
:speed-limit 10}
:main {:aspect :proceed}
:system :ks})
ks/lights)))))

(testing "main shows ks1"
(is (= {:top-white nil
:red :off
:green :on
:yellow nil
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/main {:aspect :proceed
:speed-limit 10
:zs3 :display
:system :ks})
ks/lights)))))))

(testing "zs3v"
(testing "stop"
(testing "distant shows ks2"
(is (= {:top-white nil
Expand Down Expand Up @@ -774,6 +667,20 @@
:speed-limit 10
:zs3 :sign}
:system :ks})
ks/lights))))

(testing "main shows hp0"
(is (= {:top-white nil
:red :on
:green :off
:yellow nil
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/main {:aspect :stop
:zs3 :sign
:speed-limit 10
:system :ks})
ks/lights)))))

(testing "proceed"
Expand Down Expand Up @@ -878,7 +785,21 @@
:speed-limit 10}
:main {:aspect :proceed}
:system :ks})
ks/lights))))))))
ks/lights)))))

(testing "main shows ks1"
(is (= {:top-white nil
:red :off
:green :on
:yellow nil
:center-white nil
:zs7 nil
:bottom-white nil}
(-> (signal/main {:aspect :proceed
:speed-limit 10
:zs3 :display
:system :ks})
ks/lights)))))))

(testing "zs7"
(testing "stop"
Expand Down

0 comments on commit d80ea2b

Please sign in to comment.