diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2024-07-28 18:24:22 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2024-07-28 18:24:22 +0200 |
| commit | c3c8381b5d376263f4b14ea3e5328f7ab8ad2142 (patch) | |
| tree | 3365e8a1f8877c25084e7c86072617ff7f498716 /ride/climb_test.go | |
| parent | 406625f7074233b381c3e01de751250d05b04f9d (diff) | |
test: Add failing test for climb inside long false flat
Diffstat (limited to 'ride/climb_test.go')
| -rw-r--r-- | ride/climb_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ride/climb_test.go b/ride/climb_test.go index ec74e56..23c7a2e 100644 --- a/ride/climb_test.go +++ b/ride/climb_test.go @@ -66,6 +66,14 @@ func TestClimbThenFalseFlat(t *testing.T) { assert.Equal(t, "0.0km-2.0km: 2.0km at 7.0% (98 pts - Cat 3)", r.String(climbs[0])) } +func TestSmallClimbWithDescentInsideFalseFlat(t *testing.T) { + r := RideBuilder{precision: 100}.WithSection("10km at 1%").WithSection("2km at 7%").WithSection("1km at -7%").WithSection("10km at 1%").Build() + climbs := r.AllClimbs() + + assert.Len(t, climbs, 1) + assert.Equal(t, "10.0km-12.0km: 2.0km at 7.0% (98 pts - Cat 3)", r.String(climbs[0])) +} + func TestPogacar20220721(t *testing.T) { gpxContent, err := gpx.ParseFile("../examples/2022-07-21.Pogacar.gpx") assert.NoError(t, err) |