Created
December 11, 2020 16:33
-
-
Save cameronmoreau/25366276e04d189e9d35ff0bdda4c016 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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