Skip to content

use accessing when appropriate #6670

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

Merged
merged 1 commit into from
Oct 8, 2022
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
9 changes: 5 additions & 4 deletions test/clj/game/cards/agendas_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,9 @@
(click-prompt state :corp "1 [Credits]")
(click-prompt state :runner "Card from hand")
(click-card state :corp "Hedge Fund")
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (= "You accessed Caprice Nisei." (:msg (prompt-map :runner))))
(is (accessing state "Caprice Nisei"))
(click-prompt state :runner "No action")
(is (not (:run @state)) "Run completed")))

Expand Down Expand Up @@ -4138,7 +4138,8 @@
(click-prompt state :runner "HQ")
(card-ability state :corp (refresh tm) 0)
(run-continue state)
(click-prompt state :runner "No action")) ; accessed Hedge Fund
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action"))
(changes-val-macro 3 (:credit (get-runner))
"Gained 5c from DL"
(play-from-hand state :runner "Dirty Laundry")
Expand Down Expand Up @@ -4178,7 +4179,7 @@
(card-ability state :corp (refresh tm) 0)
(run-continue state)
(is (empty? (-> (get-runner) :register :successful-run)))
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))) "No stargate prompt")
(is (accessing state "Hedge Fund") "No stargate prompt")
(click-prompt state :runner "No action"))))

(deftest transport-monopoly-successful-runs-bugs-issue-4735
Expand Down
10 changes: 5 additions & 5 deletions test/clj/game/cards/events_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5678,7 +5678,7 @@
(click-card state :runner "Easy Mark")
(is (= 1 (-> (get-runner) :hand count)))
(is (= "Easy Mark" (-> (get-runner) :hand first :title)))
(is (= "You accessed Anoetic Void." (:msg (prompt-map :runner))) "Runner access Anoetic Void")
(is (accessing state "Anoetic Void"))
(click-prompt state :runner "No action")
(is (nil? (get-run)) "Run is ended")))

Expand Down Expand Up @@ -5943,7 +5943,7 @@
(core/move state :corp (find-card "Fire Wall" (:deck (get-corp))) :deck)
(take-credits state :corp)
(play-run-event state "Showing Off" :rd)
(is (= "You accessed Fire Wall." (:msg (prompt-map :runner))) "The accessed card is on the bottom of the deck")
(is (accessing state "Fire Wall") "The accessed card is on the bottom of the deck")
(is (= "Accelerated Beta Test" (-> (get-corp) :deck first :title)) "The top of the deck is an entirely different card")
(click-prompt state :runner "No action")))

Expand Down Expand Up @@ -6350,11 +6350,11 @@
:runner {:deck ["The Maker's Eye"]}})
(take-credits state :corp)
(play-run-event state "The Maker's Eye" :rd)
(is (= "You accessed Quandary." (:msg (prompt-map :runner))) "1st quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (= "You accessed Quandary." (:msg (prompt-map :runner))) "2nd quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (= "You accessed Quandary." (:msg (prompt-map :runner))) "3rd quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (not (:run @state)))))

Expand Down
14 changes: 7 additions & 7 deletions test/clj/game/cards/hardware_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1504,19 +1504,19 @@
(play-from-hand state :runner "Doppelgänger")
(play-from-hand state :runner "The Maker's Eye")
(run-continue state)
(is (= "You accessed Quandary." (-> (get-runner) :prompt first :msg)) "1st quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (= "You accessed Quandary." (-> (get-runner) :prompt first :msg)) "2nd quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (= "You accessed Quandary." (-> (get-runner) :prompt first :msg)) "3rd quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (not (:run @state)))
(click-prompt state :runner "Yes")
(click-prompt state :runner "R&D")
(is (:run @state) "New run started")
(run-continue state)
(is (= [:rd] (:server (:run @state))) "Running on R&D")
(is (= "You accessed Quandary." (-> (get-runner) :prompt first :msg)) "1st quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (not (:run @state)))))

Expand Down Expand Up @@ -2894,7 +2894,7 @@
(take-credits state :corp)
(play-from-hand state :runner "Maya")
(run-empty-server state "R&D")
(is (= "You accessed Hostile Takeover." (:msg (prompt-map :runner))))
(is (accessing state "Hostile Takeover"))
(click-prompt state :runner "Steal")
(is (= "Move Hostile Takeover to the bottom of R&D?" (:msg (prompt-map :runner))))
(click-prompt state :runner "Yes")
Expand All @@ -2907,7 +2907,7 @@
(run-empty-server state "R&D")
(click-prompt state :corp "Yes")
(is (zero? (count (:hand (get-runner)))) "Runner took Snare! net damage")
(is (= "You accessed Snare!." (:msg (prompt-map :runner))))
(is (accessing state "Snare!"))
(click-prompt state :runner "Pay 0 [Credits] to trash")
(click-prompt state :runner "Yes")
(is (no-prompt? state :runner) "No more prompts for runner")
Expand All @@ -2927,7 +2927,7 @@
(play-from-hand state :runner "Maya")
(play-from-hand state :runner "R&D Interface")
(run-empty-server state :rd)
(is (= "You accessed Scorched Earth." (:msg (prompt-map :runner))) "Accessing the top card of R&D")
(is (accessing state "Scorched Earth") "Accessing the top card of R&D")
(click-prompt state :runner "No action")
(click-prompt state :runner "Yes")
(is (= "Scorched Earth" (:title (last (:deck (get-corp))))) "Maya moved the accessed card to the bottom of R&D")
Expand Down
11 changes: 5 additions & 6 deletions test/clj/game/cards/ice_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@
(is (last-log-contains? state "prevent the Runner from stealing or trashing"))
(run-continue state :movement)
(run-continue state :success)
(is (= "You accessed Merger." (:msg (prompt-map :runner))))
(is (accessing state "Merger"))
(is (= ["No action"] (prompt-buttons :runner)))))
(testing "Third sub blocks stealing and trashing: trashing"
(do-game state
Expand All @@ -448,7 +448,7 @@
(is (last-log-contains? state "prevent the Runner from stealing or trashing"))
(run-continue state :movement)
(run-continue state :success)
(is (= "You accessed NGO Front." (:msg (prompt-map :runner))))
(is (accessing state "NGO Front"))
(is (= ["No action"] (prompt-buttons :runner)))))))

(deftest ansel-1-0-access-after-no-steal
Expand All @@ -472,7 +472,7 @@
(run-continue state :movement)
(run-continue state :success)
(click-card state :runner "Merger")
(is (= "You accessed Merger." (:msg (prompt-map :runner))))
(is (accessing state "Merger"))
(is (= ["No action"] (prompt-buttons :runner)))
(click-prompt state :runner "No action")
(is (= :waiting (prompt-type :runner))
Expand Down Expand Up @@ -514,7 +514,7 @@
(click-card state :corp (get-resource state 0))
(is (nil? (get-resource state 0)) "Bank Job is trashed")
(encounter-continue state)
(is (= "You accessed Archangel." (:msg (prompt-map :runner))) "Return to accessing Archangel")))
(is (accessing state "Archangel") "Return to accessing Archangel")))

(deftest architect-architect-is-untrashable-while-installed-and-rezzed-but-trashable-if-derezzed-or-from-hq
;; Architect is untrashable while installed and rezzed, but trashable if derezzed or from HQ
Expand Down Expand Up @@ -4875,8 +4875,7 @@
(is (= ["Access a card in Server 2"] (prompt-buttons :runner)) "Runner should have 1 option")
(click-prompt state :runner "Access a card in Server 2")
(click-prompt state :corp "Yes")
(is (= "You accessed Project Junebug." (:msg (prompt-map :runner)))
"Runner should access Project Junebug.")
(is (accessing state "Project Junebug"))
(click-prompt state :runner "No action")
(is (= :corp (:winner @state)) "Corp has won"))))

Expand Down
10 changes: 5 additions & 5 deletions test/clj/game/cards/identities_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,7 @@
(run-continue state)
(click-prompt state :runner "HQ")
(is (= [:hq] (get-in @state [:runner :register :successful-run])))
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (= 3 (:click (get-runner))))
(card-ability state :runner omar 0)
Expand Down Expand Up @@ -4099,11 +4099,11 @@
(is (empty? (filter #(= "The Maker's Eye" (:title %)) (-> (get-corp) :prompt first :choices))) "No Maker's Eye choice")
(click-prompt state :corp "Cancel")
(run-continue state)
(is (= "You accessed Quandary." (:msg (prompt-map :runner))) "1st quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (= "You accessed Quandary." (:msg (prompt-map :runner))) "2nd quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (= "You accessed Quandary." (:msg (prompt-map :runner))) "3rd quandary")
(is (accessing state "Quandary"))
(click-prompt state :runner "No action")
(is (not (:run @state)))
(card-ability state :corp (get-in @state [:corp :identity]) 0)
Expand Down Expand Up @@ -4247,7 +4247,7 @@
(rez state :corp (refresh (get-content state :remote1 0)))
(take-credits state :corp)
(run-empty-server state :hq)
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))) "No Steve Cambridge prompt, go direct to access.")))
(is (accessing state "Hedge Fund") "No Steve Cambridge prompt, go direct to access.")))

(deftest strategic-innovations-future-forward
;; Strategic Innovations: Future Forward
Expand Down
2 changes: 1 addition & 1 deletion test/clj/game/cards/programs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@
(is (= 0 (get-counters (get-program state 0) :virus)) "Has no virus tokens")
(run-on state "HQ")
(run-continue-until state :success)
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (no-prompt? state :runner) "No prompt with no virus counters")))

Expand Down
12 changes: 6 additions & 6 deletions test/clj/game/cards/resources_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,9 @@
(run-continue state)
(is (= [:hq] (get-in @state [:runner :register :successful-run])))
(click-prompt state :runner "2")
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (= 1 (count (:discard (get-runner)))) "Counter Surveillance trashed")
(is (= 2 (:credit (get-runner))) "Runner has 2 credits"))))
Expand All @@ -984,10 +984,10 @@
(is (= [:hq] (get-in @state [:runner :register :successful-run])))
(is (zero? (count (:hand (get-runner)))) "Runner did not draw cards from Obelus yet")
(click-prompt state :runner "2")
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(is (zero? (count (:hand (get-runner)))) "Runner did not draw cards from Obelus yet")
(click-prompt state :runner "No action")
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (= 2 (count (:hand (get-runner)))) "Runner did draw cards from Obelus after all accesses are done")
(is (= 1 (count (:discard (get-runner)))) "Counter Surveillance trashed")
Expand Down Expand Up @@ -3114,7 +3114,7 @@
(click-prompt state :runner "Yes")
(click-prompt state :runner "R&D")
(run-continue state :success)
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (not (get-run)) "Run has ended")
(is (no-prompt? state :corp) "Corp does not have a start of turn wait prompt")))
Expand Down Expand Up @@ -6322,7 +6322,7 @@
(is (zero? (get-counters (refresh ttw) :power)) "Using The Turning Wheel ability costs 2 counters")
(run-continue state)
(is (zero? (core/access-bonus-count state :runner :hq)) "Runner should access 0 additional card")
(is (= "You accessed Fire Wall." (:msg (prompt-map :runner))))
(is (accessing state "Fire Wall"))
(click-prompt state :runner "No action")
(is (no-prompt? state :runner) "Runner should have no more access prompts available"))))

Expand Down
7 changes: 3 additions & 4 deletions test/clj/game/cards/upgrades_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@
(run-continue state)
(run-continue state)
(is (last-log-contains? state "Runner accesses Ganked!") "Ganked! message printed to log")
(is (= "You accessed Ganked!." (:msg (prompt-map :runner))) "Runner has normal access prompt")
(is (accessing state "Ganked!") "Runner has normal access prompt")
(click-prompt state :runner "No action")
(is (not (get-run)) "Run has been ended")
(is (no-prompt? state :corp) "No more prompts")
Expand Down Expand Up @@ -2774,8 +2774,7 @@
(click-prompt state :corp "Accelerated Beta Test")
(click-card state :corp "Beanstalk Royalties")
(click-prompt state :runner "Card from deck")
(is (= "You accessed Beanstalk Royalties." (:msg (prompt-map :runner)))
"Runner accesses switched card")
(is (accessing state "Beanstalk Royalties") "Runner accesses switched card")
(click-prompt state :runner "No action")
(click-prompt state :runner "No action")
(is (find-card "Accelerated Beta Test" (:hand (get-corp))))
Expand Down Expand Up @@ -2929,7 +2928,7 @@
(rez state :corp (get-content state :hq 0))
(score-agenda state :corp (get-content state :remote1 0))
;; Gang sign fires
(is (= "You accessed Project Beale." (:msg (prompt-map :runner))))
(is (accessing state "Project Beale"))
(is (= ["No action"] (prompt-buttons :runner)))
(click-prompt state :runner "No action")
(is (zero? (count (:scored (get-runner)))) "No stolen agendas")))
Expand Down
20 changes: 10 additions & 10 deletions test/clj/game/core/access_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,21 @@
(run-continue state)
(is (= ["Card from deck" "Midway Station Grid" "Unrezzed upgrade"] (prompt-buttons :runner)))
(click-prompt state :runner "Card from deck")
(is (= "You accessed Hedge Fund." (:msg (prompt-map :runner))))
(is (accessing state "Hedge Fund"))
(click-prompt state :runner "No action")
(is (= ["Card from deck" "Midway Station Grid" "Unrezzed upgrade"] (prompt-buttons :runner)))
(click-prompt state :runner "Unrezzed upgrade")
(is (= "You accessed Keegan Lane." (:msg (prompt-map :runner))))
(is (accessing state "Keegan Lane"))
(click-prompt state :runner "No action")
(is (= ["Card from deck" "Midway Station Grid"] (prompt-buttons :runner)))
(click-prompt state :runner "Card from deck")
(is (= "You accessed Sweeps Week." (:msg (prompt-map :runner))))
(is (accessing state "Sweeps Week"))
(click-prompt state :runner "No action")
(is (= ["Card from deck" "Midway Station Grid"] (prompt-buttons :runner)))
(click-prompt state :runner "Midway Station Grid")
(is (= "You accessed Midway Station Grid." (:msg (prompt-map :runner))))
(is (accessing state "Midway Station Grid"))
(click-prompt state :runner "No action")
(is (= "You accessed Manhunt." (:msg (prompt-map :runner))))
(is (accessing state "Manhunt"))
(click-prompt state :runner "No action")
(is (no-prompt? state :runner) "Runner has no access prompt")
(is (nil? (get-run)) "Run has ended normally")))
Expand Down Expand Up @@ -357,7 +357,7 @@
(is (= ["Hostile Takeover" "15 Minutes"] (prompt-buttons :runner)))
(click-prompt state :runner "Hostile Takeover")
(click-prompt state :runner "Steal")
(is (= "You accessed 15 Minutes." (:msg (prompt-map :runner))))
(is (accessing state "15 Minutes"))
(click-prompt state :runner "Steal")
(is (nil? (get-run)))
(is (no-prompt? state :runner))
Expand Down Expand Up @@ -393,7 +393,7 @@
(click-prompt state :runner "Cyberdex Virus Suite")
(is (prompt-is-type? state :runner :waiting))
(click-prompt state :corp "Yes")
(is (= "You accessed Hostile Takeover." (:msg (prompt-map :runner))))
(is (accessing state "Hostile Takeover"))
(click-prompt state :runner "Steal")
(is (= 1 (:agenda-point (get-runner))))))
(testing "contains non-interactive cards, agendas, and access abilities"
Expand Down Expand Up @@ -495,7 +495,7 @@
(is (= ["Bryan Stinson" "Facedown card in Archives"] (prompt-buttons :runner)))
(click-prompt state :runner "Facedown card in Archives")
(is (second-last-log-contains? state "Runner accesses Hedge Fund from Archives."))
(is (= "You accessed Bryan Stinson." (:msg (prompt-map :runner))))
(is (accessing state "Bryan Stinson"))
(is (= ["Pay 5 [Credits] to trash" "No action"] (prompt-buttons :runner)))
(click-prompt state :runner "No action")
(is (no-prompt? state :corp))
Expand All @@ -510,7 +510,7 @@
(click-prompt state :runner "Steal")
(click-prompt state :runner "Breaking News")
(click-prompt state :runner "Steal")
(is (= "You accessed Breaking News." (:msg (prompt-map :runner))))
(is (accessing state "Breaking News"))
(click-prompt state :runner "Steal")
(is (= 3 (count (:scored (get-runner)))) "3 agendas stolen")
(is (empty (:discard (get-corp))) "0 agendas left in archives")))
Expand All @@ -523,7 +523,7 @@
(is (= ["Global Food Initiative" "Everything else"] (prompt-buttons :runner)))
(click-prompt state :runner "Everything else")
(is (second-last-log-contains? state "Runner accesses everything else in Archives"))
(is (= "You accessed Global Food Initiative." (:msg (prompt-map :runner))))
(is (accessing state "Global Food Initiative"))
(is (= ["Steal"] (prompt-buttons :runner)))
(click-prompt state :runner "Steal")))
(testing "Looping Ganked! and Ansel"
Expand Down
Loading