diff options
Diffstat (limited to 'official_climb/official_climb_test.go')
| -rw-r--r-- | official_climb/official_climb_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/official_climb/official_climb_test.go b/official_climb/official_climb_test.go index a0c8d65..266581e 100644 --- a/official_climb/official_climb_test.go +++ b/official_climb/official_climb_test.go @@ -68,7 +68,7 @@ func TestMatchClimbMatchesWithoutDetectedClimb(t *testing.T) { StartCoord: parsed.Coord(1), EndCoord: parsed.Coord(2), } - matched, found := official_climb.MatchClimb(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + matched, found := official_climb.MatchClimb(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) require.True(t, found) assert.Equal(t, 1, matched.StartIndex) assert.Equal(t, 2, matched.EndIndex) @@ -91,7 +91,7 @@ func TestMatchClimbMatchesEndpointInsideRadius(t *testing.T) { StartCoord: geodist.Coord{Lat: 43.1101, Lon: 5.1101}, EndCoord: geodist.Coord{Lat: 43.1201, Lon: 5.1201}, } - matched, found := official_climb.MatchClimb(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + matched, found := official_climb.MatchClimb(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) require.True(t, found) assert.Equal(t, 1, matched.StartIndex) assert.Equal(t, 2, matched.EndIndex) @@ -114,7 +114,7 @@ func TestMatchClimbRejectsReversedEndpoints(t *testing.T) { StartCoord: parsed.Coord(2), EndCoord: parsed.Coord(1), } - _, found := official_climb.MatchClimb(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + _, found := official_climb.MatchClimb(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) assert.False(t, found) } @@ -135,7 +135,7 @@ func TestMatchClimbRejectsEndpointOutsideRadius(t *testing.T) { StartCoord: geodist.Coord{Lat: 43.09, Lon: 5.09}, EndCoord: parsed.Coord(2), } - _, found := official_climb.MatchClimb(parsed.Coords, official, 10) + _, found := official_climb.MatchClimb(parsed.Coords(), official, 10) assert.False(t, found) } @@ -161,14 +161,14 @@ func TestMatchClimbsMatchesTwoLaps(t *testing.T) { StartCoord: geodist.Coord{Lat: 43.10, Lon: 5.10}, EndCoord: geodist.Coord{Lat: 43.12, Lon: 5.12}, } - matches := official_climb.MatchClimbs(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + matches := official_climb.MatchClimbs(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) require.Len(t, matches, 2) assert.Equal(t, 0, matches[0].StartIndex) assert.Equal(t, 2, matches[0].EndIndex) assert.Equal(t, 4, matches[1].StartIndex) assert.Equal(t, 6, matches[1].EndIndex) // Single-match helper still returns first occurrence for backward compatibility. - single, found := official_climb.MatchClimb(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + single, found := official_climb.MatchClimb(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) require.True(t, found) assert.Equal(t, 0, single.StartIndex) } @@ -193,7 +193,7 @@ func TestMatchClimbsMatchesOnlyCompleteLaps(t *testing.T) { StartCoord: geodist.Coord{Lat: 43.10, Lon: 5.10}, EndCoord: geodist.Coord{Lat: 43.12, Lon: 5.12}, } - matches := official_climb.MatchClimbs(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + matches := official_climb.MatchClimbs(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) require.Len(t, matches, 1) assert.Equal(t, 3, matches[0].StartIndex) assert.Equal(t, 5, matches[0].EndIndex) @@ -216,7 +216,7 @@ func TestMatchClimbsPreservesDirectionAcrossLaps(t *testing.T) { StartCoord: geodist.Coord{Lat: 43.10, Lon: 5.10}, EndCoord: geodist.Coord{Lat: 43.12, Lon: 5.12}, } - matches := official_climb.MatchClimbs(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + matches := official_climb.MatchClimbs(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) assert.Empty(t, matches) } @@ -242,7 +242,7 @@ func TestMatchClimbsClustersContiguousPoints(t *testing.T) { StartCoord: geodist.Coord{Lat: 43.10, Lon: 5.10}, EndCoord: geodist.Coord{Lat: 43.12, Lon: 5.12}, } - matches := official_climb.MatchClimbs(parsed.Coords, official, official_climb.DefaultMatchRadiusM) + matches := official_climb.MatchClimbs(parsed.Coords(), official, official_climb.DefaultMatchRadiusM) require.Len(t, matches, 2) assert.Equal(t, 0, matches[0].StartIndex) assert.Equal(t, 4, matches[0].EndIndex) |
