Skip to content

Commit

Permalink
Add a unit test for InputAttemptIdentifier.incldues()
Browse files Browse the repository at this point in the history
  • Loading branch information
ngsg committed Dec 25, 2024
1 parent bf3a819 commit 094e4f5
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,23 @@ public void testInputAttemptIdentifier() {
Assert.assertTrue(set.add(i4));
}

@Test(timeout = 5000)
public void testInputAttemptIdentifierIncludes() {
InputAttemptIdentifier inputData0Attempt0 = new InputAttemptIdentifier(0, 0);
InputAttemptIdentifier inputData1Attempt0 = new InputAttemptIdentifier(1, 0);
InputAttemptIdentifier inputData2Attempt0 = new InputAttemptIdentifier(2, 0);
InputAttemptIdentifier inputData3Attempt0 = new InputAttemptIdentifier(3, 0);
InputAttemptIdentifier inputData1Attempt1 = new InputAttemptIdentifier(1, 1);
CompositeInputAttemptIdentifier inputData12Attempt0 = new CompositeInputAttemptIdentifier(1, 0, null, 2);

Assert.assertTrue(inputData1Attempt0.includes(inputData1Attempt0));
Assert.assertFalse(inputData1Attempt0.includes(inputData2Attempt0));
Assert.assertFalse(inputData1Attempt0.includes(inputData1Attempt1));

Assert.assertFalse(inputData12Attempt0.includes(inputData0Attempt0));
Assert.assertTrue(inputData12Attempt0.includes(inputData1Attempt0));
Assert.assertTrue(inputData12Attempt0.includes(inputData2Attempt0));
Assert.assertFalse(inputData12Attempt0.includes(inputData3Attempt0));
Assert.assertFalse(inputData12Attempt0.includes(inputData1Attempt1));
}
}

0 comments on commit 094e4f5

Please sign in to comment.