terminate return value logic is very unclear. It is actually about stacking messages on the initial message, but the description is too cryptic about this.
(Also, the description is tl;dr and very obtuse in general, it should be rewritten to be more concise.)
The order of ForwardMessages within the Vec is irrelevant. It is only important that the Vec contain all message forwarding events that are immediately triggered by msg.
This is only done for random tests; fixed tests expect a specific order.
0 < sender < n identifies the sending player with successor(x) = x + 1 % n and predecessor(x) = successor⁻¹(x) describing the cyclical order of the players.
It should be 0 <= sender < n and successor(x) = (x + 1) % n
In Rust, in some random tests the provided ids in the lifts list are not unique and the test can only be passed if you use the id's first appearance.
This defies the concept of an id.
Furthermore sometimes ids are passed in the rides list which do not occur in the lifts List.
It either should be specified in the description what happens in these cases or the tests should be corrected.
terminate
return value logic is very unclear. It is actually about stacking messages on the initial message, but the description is too cryptic about this.(Also, the description is tl;dr and very obtuse in general, it should be rewritten to be more concise.)
This is only done for random tests; fixed tests expect a specific order.
Description contains key errors:
It should be
0 <= sender < n
andsuccessor(x) = (x + 1) % n
People should get into the habit of writing some text in their code for newer people
This comment is hidden because it contains spoiler information about the solution
You're right, I re-published with better tests.
Details
I was relying on quickcheck before, but it's too random.
I removed quickcheck, and replaced the random tests with one where the id's are guaranteed to be unique.
I also made sure the rides id list is limited to the ids in the lifts id range.
In Rust, in some random tests the provided ids in the
lifts
list are not unique and the test can only be passed if you use the id's first appearance.This defies the concept of an id.
Furthermore sometimes ids are passed in the
rides
list which do not occur in thelifts
List.It either should be specified in the description what happens in these cases or the tests should be corrected.