Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/pascalgn/automer…
Browse files Browse the repository at this point in the history
…ge-action-0.16.2
  • Loading branch information
gucio321 authored Feb 1, 2024
2 parents 6efad61 + 9acdd2d commit 01af85b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-author-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v2.0.1
- uses: toshimaru/auto-author-assign@v2.1.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
sudo apt-get install -y libgtk-3-dev libasound2-dev libxxf86vm-dev
- name: Cache Go modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
12 changes: 6 additions & 6 deletions pkg/core/pcplayer/pc_player_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func TestGetPCMove(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := NewPCPlayer(tt.args.gameBoard, tt.args.pcLetter).GetMove()
got := NewPCPlayer(tt.args.gameBoard, tt.args.pcLetter, AlgOriginal).GetMove()

assert.Truef(
t, contains(tt.want, got),
Expand Down Expand Up @@ -304,8 +304,8 @@ func TestGetPCMove_FullBoard(t *testing.T) {
SetIndexState(14, letter.LetterX).
SetIndexState(15, letter.LetterO)

assert.Panics(t, func() { NewPCPlayer(gameBoard, letter.LetterX).GetMove() }, "GetPCMove on full board didn't panicked")
assert.Panics(t, func() { NewPCPlayer(gameBoard, letter.LetterO).GetMove() }, "GetPCMove on full board didn't panicked")
assert.Panics(t, func() { NewPCPlayer(gameBoard, letter.LetterX, AlgOriginal).GetMove() }, "GetPCMove on full board didn't panicked")
assert.Panics(t, func() { NewPCPlayer(gameBoard, letter.LetterO, AlgOriginal).GetMove() }, "GetPCMove on full board didn't panicked")
}

//nolint:funlen // tests function; it is ok
Expand Down Expand Up @@ -462,8 +462,8 @@ func Test_canWin(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotCanWinX, gotResultsX := NewPCPlayer(tt.args.baseBoard, letter.LetterX).canWin(tt.args.baseBoard, letter.LetterX)
gotCanWinO, gotResultsO := NewPCPlayer(tt.args.baseBoard, letter.LetterO).canWin(tt.args.baseBoard, letter.LetterO)
gotCanWinX, gotResultsX := NewPCPlayer(tt.args.baseBoard, letter.LetterX, AlgOriginal).canWin(tt.args.baseBoard, letter.LetterX)
gotCanWinO, gotResultsO := NewPCPlayer(tt.args.baseBoard, letter.LetterO, AlgOriginal).canWin(tt.args.baseBoard, letter.LetterO)
assert.Equal(t, gotCanWinX, tt.wantCanWinX, "canWin returned unexpected value")
assert.Equal(t, gotResultsX, tt.wantResultsX, "canWin returned unexpected value (list of winning combos)")
assert.Equal(t, gotCanWinO, tt.wantCanWinO, "canWin returned unexpected value")
Expand Down Expand Up @@ -536,7 +536,7 @@ func Test_canWinTwoMoves(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotResult := NewPCPlayer(tt.args.gameBoard, tt.args.player).canWinTwoMoves(tt.args.gameBoard, tt.args.player)
gotResult := NewPCPlayer(tt.args.gameBoard, tt.args.player, AlgOriginal).canWinTwoMoves(tt.args.gameBoard, tt.args.player)
assert.Equal(t, tt.wantResult, gotResult, "canWinTwoMoves() = %v, want %v", gotResult, tt.wantResult)
})
}
Expand Down

0 comments on commit 01af85b

Please sign in to comment.