import { expect, test } from 'vitest';
import * as course from './course';
import { Phase } from './race';

test.for<{ raceLen: number; slopes: course.Slope[]; want: course.SectionSlopeSegment[] }>([
	{
		raceLen: 1200,
		slopes: [],
		want: [
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 0,
				endDist: 50,
				slope: 0,
			},
			{
				section: 2,
				phase: Phase.EarlyRace,
				endRate: 2 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 50,
				endDist: 100,
				slope: 0,
			},
			{
				section: 3,
				phase: Phase.EarlyRace,
				endRate: 3 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 100,
				endDist: 150,
				slope: 0,
			},
			{
				section: 4,
				phase: Phase.EarlyRace,
				endRate: 4 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 150,
				endDist: 200,
				slope: 0,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 200,
				endDist: 250,
				slope: 0,
			},
			{
				section: 6,
				phase: Phase.MidRace,
				endRate: 6 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 250,
				endDist: 300,
				slope: 0,
			},
			{
				section: 7,
				phase: Phase.MidRace,
				endRate: 7 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 300,
				endDist: 350,
				slope: 0,
			},
			{
				section: 8,
				phase: Phase.MidRace,
				endRate: 8 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 350,
				endDist: 400,
				slope: 0,
			},
			{
				section: 9,
				phase: Phase.MidRace,
				endRate: 9 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 400,
				endDist: 450,
				slope: 0,
			},
			{
				section: 10,
				phase: Phase.MidRace,
				endRate: 10 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 450,
				endDist: 500,
				slope: 0,
			},
			{
				section: 11,
				phase: Phase.MidRace,
				endRate: 11 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 500,
				endDist: 550,
				slope: 0,
			},
			{
				section: 12,
				phase: Phase.MidRace,
				endRate: 12 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 550,
				endDist: 600,
				slope: 0,
			},
			{
				section: 13,
				phase: Phase.MidRace,
				endRate: 13 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 600,
				endDist: 650,
				slope: 0,
			},
			{
				section: 14,
				phase: Phase.MidRace,
				endRate: 14 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 650,
				endDist: 700,
				slope: 0,
			},
			{
				section: 15,
				phase: Phase.MidRace,
				endRate: 15 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 700,
				endDist: 750,
				slope: 0,
			},
			{
				section: 16,
				phase: Phase.MidRace,
				endRate: 16 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 750,
				endDist: 800,
				slope: 0,
			},
			{
				section: 17,
				phase: Phase.LateRace,
				endRate: 17 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 800,
				endDist: 850,
				slope: 0,
			},
			{
				section: 18,
				phase: Phase.LateRace,
				endRate: 18 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 850,
				endDist: 900,
				slope: 0,
			},
			{
				section: 19,
				phase: Phase.LateRace,
				endRate: 19 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 900,
				endDist: 950,
				slope: 0,
			},
			{
				section: 20,
				phase: Phase.LateRace,
				endRate: 20 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 950,
				endDist: 1000,
				slope: 0,
			},
			{
				section: 21,
				phase: Phase.LateRace,
				endRate: 21 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1000,
				endDist: 1050,
				slope: 0,
			},
			{
				section: 22,
				phase: Phase.LateRace,
				endRate: 22 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1050,
				endDist: 1100,
				slope: 0,
			},
			{
				section: 23,
				phase: Phase.LateRace,
				endRate: 23 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1100,
				endDist: 1150,
				slope: 0,
			},
			{
				section: 24,
				phase: Phase.LateRace,
				endRate: 24 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1150,
				endDist: 1200,
				slope: 0,
			},
		],
	},
	{
		raceLen: 1200,
		slopes: [{ per: 1, span: [0, 25] }],
		want: [
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 0,
				endDist: 25,
				slope: 1,
			},
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 25,
				endDist: 50,
				slope: 0,
			},
			{
				section: 2,
				phase: Phase.EarlyRace,
				endRate: 2 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 50,
				endDist: 100,
				slope: 0,
			},
			{
				section: 3,
				phase: Phase.EarlyRace,
				endRate: 3 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 100,
				endDist: 150,
				slope: 0,
			},
			{
				section: 4,
				phase: Phase.EarlyRace,
				endRate: 4 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 150,
				endDist: 200,
				slope: 0,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 200,
				endDist: 250,
				slope: 0,
			},
			{
				section: 6,
				phase: Phase.MidRace,
				endRate: 6 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 250,
				endDist: 300,
				slope: 0,
			},
			{
				section: 7,
				phase: Phase.MidRace,
				endRate: 7 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 300,
				endDist: 350,
				slope: 0,
			},
			{
				section: 8,
				phase: Phase.MidRace,
				endRate: 8 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 350,
				endDist: 400,
				slope: 0,
			},
			{
				section: 9,
				phase: Phase.MidRace,
				endRate: 9 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 400,
				endDist: 450,
				slope: 0,
			},
			{
				section: 10,
				phase: Phase.MidRace,
				endRate: 10 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 450,
				endDist: 500,
				slope: 0,
			},
			{
				section: 11,
				phase: Phase.MidRace,
				endRate: 11 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 500,
				endDist: 550,
				slope: 0,
			},
			{
				section: 12,
				phase: Phase.MidRace,
				endRate: 12 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 550,
				endDist: 600,
				slope: 0,
			},
			{
				section: 13,
				phase: Phase.MidRace,
				endRate: 13 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 600,
				endDist: 650,
				slope: 0,
			},
			{
				section: 14,
				phase: Phase.MidRace,
				endRate: 14 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 650,
				endDist: 700,
				slope: 0,
			},
			{
				section: 15,
				phase: Phase.MidRace,
				endRate: 15 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 700,
				endDist: 750,
				slope: 0,
			},
			{
				section: 16,
				phase: Phase.MidRace,
				endRate: 16 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 750,
				endDist: 800,
				slope: 0,
			},
			{
				section: 17,
				phase: Phase.LateRace,
				endRate: 17 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 800,
				endDist: 850,
				slope: 0,
			},
			{
				section: 18,
				phase: Phase.LateRace,
				endRate: 18 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 850,
				endDist: 900,
				slope: 0,
			},
			{
				section: 19,
				phase: Phase.LateRace,
				endRate: 19 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 900,
				endDist: 950,
				slope: 0,
			},
			{
				section: 20,
				phase: Phase.LateRace,
				endRate: 20 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 950,
				endDist: 1000,
				slope: 0,
			},
			{
				section: 21,
				phase: Phase.LateRace,
				endRate: 21 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1000,
				endDist: 1050,
				slope: 0,
			},
			{
				section: 22,
				phase: Phase.LateRace,
				endRate: 22 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1050,
				endDist: 1100,
				slope: 0,
			},
			{
				section: 23,
				phase: Phase.LateRace,
				endRate: 23 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1100,
				endDist: 1150,
				slope: 0,
			},
			{
				section: 24,
				phase: Phase.LateRace,
				endRate: 24 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1150,
				endDist: 1200,
				slope: 0,
			},
		],
	},
	{
		raceLen: 1200,
		slopes: [{ per: 1, span: [0, 50] }],
		want: [
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 0,
				endDist: 50,
				slope: 1,
			},
			{
				section: 2,
				phase: Phase.EarlyRace,
				endRate: 2 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 50,
				endDist: 100,
				slope: 0,
			},
			{
				section: 3,
				phase: Phase.EarlyRace,
				endRate: 3 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 100,
				endDist: 150,
				slope: 0,
			},
			{
				section: 4,
				phase: Phase.EarlyRace,
				endRate: 4 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 150,
				endDist: 200,
				slope: 0,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 200,
				endDist: 250,
				slope: 0,
			},
			{
				section: 6,
				phase: Phase.MidRace,
				endRate: 6 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 250,
				endDist: 300,
				slope: 0,
			},
			{
				section: 7,
				phase: Phase.MidRace,
				endRate: 7 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 300,
				endDist: 350,
				slope: 0,
			},
			{
				section: 8,
				phase: Phase.MidRace,
				endRate: 8 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 350,
				endDist: 400,
				slope: 0,
			},
			{
				section: 9,
				phase: Phase.MidRace,
				endRate: 9 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 400,
				endDist: 450,
				slope: 0,
			},
			{
				section: 10,
				phase: Phase.MidRace,
				endRate: 10 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 450,
				endDist: 500,
				slope: 0,
			},
			{
				section: 11,
				phase: Phase.MidRace,
				endRate: 11 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 500,
				endDist: 550,
				slope: 0,
			},
			{
				section: 12,
				phase: Phase.MidRace,
				endRate: 12 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 550,
				endDist: 600,
				slope: 0,
			},
			{
				section: 13,
				phase: Phase.MidRace,
				endRate: 13 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 600,
				endDist: 650,
				slope: 0,
			},
			{
				section: 14,
				phase: Phase.MidRace,
				endRate: 14 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 650,
				endDist: 700,
				slope: 0,
			},
			{
				section: 15,
				phase: Phase.MidRace,
				endRate: 15 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 700,
				endDist: 750,
				slope: 0,
			},
			{
				section: 16,
				phase: Phase.MidRace,
				endRate: 16 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 750,
				endDist: 800,
				slope: 0,
			},
			{
				section: 17,
				phase: Phase.LateRace,
				endRate: 17 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 800,
				endDist: 850,
				slope: 0,
			},
			{
				section: 18,
				phase: Phase.LateRace,
				endRate: 18 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 850,
				endDist: 900,
				slope: 0,
			},
			{
				section: 19,
				phase: Phase.LateRace,
				endRate: 19 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 900,
				endDist: 950,
				slope: 0,
			},
			{
				section: 20,
				phase: Phase.LateRace,
				endRate: 20 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 950,
				endDist: 1000,
				slope: 0,
			},
			{
				section: 21,
				phase: Phase.LateRace,
				endRate: 21 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1000,
				endDist: 1050,
				slope: 0,
			},
			{
				section: 22,
				phase: Phase.LateRace,
				endRate: 22 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1050,
				endDist: 1100,
				slope: 0,
			},
			{
				section: 23,
				phase: Phase.LateRace,
				endRate: 23 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1100,
				endDist: 1150,
				slope: 0,
			},
			{
				section: 24,
				phase: Phase.LateRace,
				endRate: 24 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1150,
				endDist: 1200,
				slope: 0,
			},
		],
	},
	{
		raceLen: 1200,
		slopes: [{ per: 1, span: [0, 225] }],
		want: [
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 0,
				endDist: 50,
				slope: 1,
			},
			{
				section: 2,
				phase: Phase.EarlyRace,
				endRate: 2 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 50,
				endDist: 100,
				slope: 1,
			},
			{
				section: 3,
				phase: Phase.EarlyRace,
				endRate: 3 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 100,
				endDist: 150,
				slope: 1,
			},
			{
				section: 4,
				phase: Phase.EarlyRace,
				endRate: 4 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 150,
				endDist: 200,
				slope: 1,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 200,
				endDist: 225,
				slope: 1,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 225,
				endDist: 250,
				slope: 0,
			},
			{
				section: 6,
				phase: Phase.MidRace,
				endRate: 6 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 250,
				endDist: 300,
				slope: 0,
			},
			{
				section: 7,
				phase: Phase.MidRace,
				endRate: 7 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 300,
				endDist: 350,
				slope: 0,
			},
			{
				section: 8,
				phase: Phase.MidRace,
				endRate: 8 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 350,
				endDist: 400,
				slope: 0,
			},
			{
				section: 9,
				phase: Phase.MidRace,
				endRate: 9 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 400,
				endDist: 450,
				slope: 0,
			},
			{
				section: 10,
				phase: Phase.MidRace,
				endRate: 10 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 450,
				endDist: 500,
				slope: 0,
			},
			{
				section: 11,
				phase: Phase.MidRace,
				endRate: 11 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 500,
				endDist: 550,
				slope: 0,
			},
			{
				section: 12,
				phase: Phase.MidRace,
				endRate: 12 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 550,
				endDist: 600,
				slope: 0,
			},
			{
				section: 13,
				phase: Phase.MidRace,
				endRate: 13 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 600,
				endDist: 650,
				slope: 0,
			},
			{
				section: 14,
				phase: Phase.MidRace,
				endRate: 14 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 650,
				endDist: 700,
				slope: 0,
			},
			{
				section: 15,
				phase: Phase.MidRace,
				endRate: 15 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 700,
				endDist: 750,
				slope: 0,
			},
			{
				section: 16,
				phase: Phase.MidRace,
				endRate: 16 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 750,
				endDist: 800,
				slope: 0,
			},
			{
				section: 17,
				phase: Phase.LateRace,
				endRate: 17 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 800,
				endDist: 850,
				slope: 0,
			},
			{
				section: 18,
				phase: Phase.LateRace,
				endRate: 18 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 850,
				endDist: 900,
				slope: 0,
			},
			{
				section: 19,
				phase: Phase.LateRace,
				endRate: 19 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 900,
				endDist: 950,
				slope: 0,
			},
			{
				section: 20,
				phase: Phase.LateRace,
				endRate: 20 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 950,
				endDist: 1000,
				slope: 0,
			},
			{
				section: 21,
				phase: Phase.LateRace,
				endRate: 21 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1000,
				endDist: 1050,
				slope: 0,
			},
			{
				section: 22,
				phase: Phase.LateRace,
				endRate: 22 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1050,
				endDist: 1100,
				slope: 0,
			},
			{
				section: 23,
				phase: Phase.LateRace,
				endRate: 23 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1100,
				endDist: 1150,
				slope: 0,
			},
			{
				section: 24,
				phase: Phase.LateRace,
				endRate: 24 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1150,
				endDist: 1200,
				slope: 0,
			},
		],
	},
	{
		raceLen: 1200,
		slopes: [{ per: 1, span: [25, 50] }],
		want: [
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 0,
				endDist: 25,
				slope: 0,
			},
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 25,
				endDist: 50,
				slope: 1,
			},
			{
				section: 2,
				phase: Phase.EarlyRace,
				endRate: 2 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 50,
				endDist: 100,
				slope: 0,
			},
			{
				section: 3,
				phase: Phase.EarlyRace,
				endRate: 3 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 100,
				endDist: 150,
				slope: 0,
			},
			{
				section: 4,
				phase: Phase.EarlyRace,
				endRate: 4 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 150,
				endDist: 200,
				slope: 0,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 200,
				endDist: 250,
				slope: 0,
			},
			{
				section: 6,
				phase: Phase.MidRace,
				endRate: 6 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 250,
				endDist: 300,
				slope: 0,
			},
			{
				section: 7,
				phase: Phase.MidRace,
				endRate: 7 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 300,
				endDist: 350,
				slope: 0,
			},
			{
				section: 8,
				phase: Phase.MidRace,
				endRate: 8 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 350,
				endDist: 400,
				slope: 0,
			},
			{
				section: 9,
				phase: Phase.MidRace,
				endRate: 9 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 400,
				endDist: 450,
				slope: 0,
			},
			{
				section: 10,
				phase: Phase.MidRace,
				endRate: 10 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 450,
				endDist: 500,
				slope: 0,
			},
			{
				section: 11,
				phase: Phase.MidRace,
				endRate: 11 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 500,
				endDist: 550,
				slope: 0,
			},
			{
				section: 12,
				phase: Phase.MidRace,
				endRate: 12 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 550,
				endDist: 600,
				slope: 0,
			},
			{
				section: 13,
				phase: Phase.MidRace,
				endRate: 13 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 600,
				endDist: 650,
				slope: 0,
			},
			{
				section: 14,
				phase: Phase.MidRace,
				endRate: 14 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 650,
				endDist: 700,
				slope: 0,
			},
			{
				section: 15,
				phase: Phase.MidRace,
				endRate: 15 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 700,
				endDist: 750,
				slope: 0,
			},
			{
				section: 16,
				phase: Phase.MidRace,
				endRate: 16 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 750,
				endDist: 800,
				slope: 0,
			},
			{
				section: 17,
				phase: Phase.LateRace,
				endRate: 17 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 800,
				endDist: 850,
				slope: 0,
			},
			{
				section: 18,
				phase: Phase.LateRace,
				endRate: 18 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 850,
				endDist: 900,
				slope: 0,
			},
			{
				section: 19,
				phase: Phase.LateRace,
				endRate: 19 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 900,
				endDist: 950,
				slope: 0,
			},
			{
				section: 20,
				phase: Phase.LateRace,
				endRate: 20 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 950,
				endDist: 1000,
				slope: 0,
			},
			{
				section: 21,
				phase: Phase.LateRace,
				endRate: 21 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1000,
				endDist: 1050,
				slope: 0,
			},
			{
				section: 22,
				phase: Phase.LateRace,
				endRate: 22 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1050,
				endDist: 1100,
				slope: 0,
			},
			{
				section: 23,
				phase: Phase.LateRace,
				endRate: 23 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1100,
				endDist: 1150,
				slope: 0,
			},
			{
				section: 24,
				phase: Phase.LateRace,
				endRate: 24 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1150,
				endDist: 1200,
				slope: 0,
			},
		],
	},
	{
		raceLen: 1200,
		slopes: [
			{ per: 1, span: [10, 20] },
			{ per: -1, span: [30, 40] },
		],
		want: [
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 0,
				endDist: 10,
				slope: 0,
			},
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 10,
				endDist: 20,
				slope: 1,
			},
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 20,
				endDist: 30,
				slope: 0,
			},
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 30,
				endDist: 40,
				slope: -1,
			},
			{
				section: 1,
				phase: Phase.EarlyRace,
				endRate: 1 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 40,
				endDist: 50,
				slope: 0,
			},
			{
				section: 2,
				phase: Phase.EarlyRace,
				endRate: 2 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 50,
				endDist: 100,
				slope: 0,
			},
			{
				section: 3,
				phase: Phase.EarlyRace,
				endRate: 3 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 100,
				endDist: 150,
				slope: 0,
			},
			{
				section: 4,
				phase: Phase.EarlyRace,
				endRate: 4 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 150,
				endDist: 200,
				slope: 0,
			},
			{
				section: 5,
				phase: Phase.MidRace,
				endRate: 5 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: true,
				startDist: 200,
				endDist: 250,
				slope: 0,
			},
			{
				section: 6,
				phase: Phase.MidRace,
				endRate: 6 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 250,
				endDist: 300,
				slope: 0,
			},
			{
				section: 7,
				phase: Phase.MidRace,
				endRate: 7 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 300,
				endDist: 350,
				slope: 0,
			},
			{
				section: 8,
				phase: Phase.MidRace,
				endRate: 8 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 350,
				endDist: 400,
				slope: 0,
			},
			{
				section: 9,
				phase: Phase.MidRace,
				endRate: 9 / 24,
				posKeep: true,
				rush: true,
				spotStruggleEnter: false,
				startDist: 400,
				endDist: 450,
				slope: 0,
			},
			{
				section: 10,
				phase: Phase.MidRace,
				endRate: 10 / 24,
				posKeep: true,
				rush: false,
				spotStruggleEnter: false,
				startDist: 450,
				endDist: 500,
				slope: 0,
			},
			{
				section: 11,
				phase: Phase.MidRace,
				endRate: 11 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 500,
				endDist: 550,
				slope: 0,
			},
			{
				section: 12,
				phase: Phase.MidRace,
				endRate: 12 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 550,
				endDist: 600,
				slope: 0,
			},
			{
				section: 13,
				phase: Phase.MidRace,
				endRate: 13 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 600,
				endDist: 650,
				slope: 0,
			},
			{
				section: 14,
				phase: Phase.MidRace,
				endRate: 14 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 650,
				endDist: 700,
				slope: 0,
			},
			{
				section: 15,
				phase: Phase.MidRace,
				endRate: 15 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 700,
				endDist: 750,
				slope: 0,
			},
			{
				section: 16,
				phase: Phase.MidRace,
				endRate: 16 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 750,
				endDist: 800,
				slope: 0,
			},
			{
				section: 17,
				phase: Phase.LateRace,
				endRate: 17 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 800,
				endDist: 850,
				slope: 0,
			},
			{
				section: 18,
				phase: Phase.LateRace,
				endRate: 18 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 850,
				endDist: 900,
				slope: 0,
			},
			{
				section: 19,
				phase: Phase.LateRace,
				endRate: 19 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 900,
				endDist: 950,
				slope: 0,
			},
			{
				section: 20,
				phase: Phase.LateRace,
				endRate: 20 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 950,
				endDist: 1000,
				slope: 0,
			},
			{
				section: 21,
				phase: Phase.LateRace,
				endRate: 21 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1000,
				endDist: 1050,
				slope: 0,
			},
			{
				section: 22,
				phase: Phase.LateRace,
				endRate: 22 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1050,
				endDist: 1100,
				slope: 0,
			},
			{
				section: 23,
				phase: Phase.LateRace,
				endRate: 23 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1100,
				endDist: 1150,
				slope: 0,
			},
			{
				section: 24,
				phase: Phase.LateRace,
				endRate: 24 / 24,
				posKeep: false,
				rush: false,
				spotStruggleEnter: false,
				startDist: 1150,
				endDist: 1200,
				slope: 0,
			},
		],
	},
])('splitSectionSlopes($raceLen, $slopes)', ({ raceLen, slopes, want }) => {
	expect(course.splitSectionSlopes(raceLen, slopes)).toEqual(want);
});
