Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
it("checks for schedule conflicts", () => {
const crewInfo = {
crews: [
{
id: 2,
vehicle: "pickup_truck",
schedule: [
{
start_hour: 8,
end_hour: 13,
},
],
},
],
};
const orders = [
[[6, 7], 2],
[[8, 13], -1],
[[9, 11], -1],
[[10, 15], -1],
[[14, 15], 2],
];
orders.forEach(([time, e]) => {
assert.equal(
getOptimalCrew(crewInfo, {
vehicle: "pickup_truck",
start_hour: time[0],
end_hour: time[1],
}),
e,
`failed on ${time} ${e}`
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment