diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-20 11:14:43 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:44 +0100 |
| commit | cbed4f79f1f7f90f600ad9d1d711f82c6e09e8e5 (patch) | |
| tree | d15c0cfacf1c3668e9e19dba197dfbf5fd8c2017 /go/game/range_test.go | |
| parent | 104300e058b2406e55367d6b05425428cda15115 (diff) | |
| download | muhqs-game-cbed4f79f1f7f90f600ad9d1d711f82c6e09e8e5.tar.gz muhqs-game-cbed4f79f1f7f90f600ad9d1d711f82c6e09e8e5.zip | |
reformat using gofmtp
Diffstat (limited to 'go/game/range_test.go')
| -rw-r--r-- | go/game/range_test.go | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/go/game/range_test.go b/go/game/range_test.go index afa164de..274b3b85 100644 --- a/go/game/range_test.go +++ b/go/game/range_test.go @@ -1,13 +1,14 @@ package game import ( - "golang.org/x/exp/slices" "testing" + + "golang.org/x/exp/slices" ) func TestPositionsInRange(t *testing.T) { origin := Position{0, 0} - positionsInRange1 := []Position{Position{0, 1}, Position{1, 0}, Position{1, 1}} + positionsInRange1 := []Position{{0, 1}, {1, 0}, {1, 1}} calculatedPositions := PositionsInRange(origin, 1, false) if len(positionsInRange1) != len(calculatedPositions) { t.Fatalf("Unexpected number of calculated positions") @@ -20,11 +21,28 @@ func TestPositionsInRange(t *testing.T) { } origin = Position{2, 2} - positionsInRange2 := []Position{Position{0, 1}, Position{0, 2}, Position{0, 3}, - Position{1, 0}, Position{1, 1}, Position{1, 2}, Position{1, 3}, Position{1, 4}, - Position{2, 0}, Position{2, 1}, Position{2, 3}, Position{2, 4}, - Position{3, 0}, Position{3, 1}, Position{3, 2}, Position{3, 3}, Position{3, 4}, - Position{4, 1}, Position{4, 2}, Position{4, 3}} + positionsInRange2 := []Position{ + {0, 1}, + {0, 2}, + {0, 3}, + {1, 0}, + {1, 1}, + {1, 2}, + {1, 3}, + {1, 4}, + {2, 0}, + {2, 1}, + {2, 3}, + {2, 4}, + {3, 0}, + {3, 1}, + {3, 2}, + {3, 3}, + {3, 4}, + {4, 1}, + {4, 2}, + {4, 3}, + } calculatedPositions = PositionsInRange(origin, 2, false) for _, p := range positionsInRange2 { |
