fest-assert-2.x
fest-assert-2.x copied to clipboard
Arrays.assertContainsSequence stops after 1st potential match
Let's say I have an array that looks like this:
String[] array = new String[] { "--option", "a=b", "--option", "c=d" };
I want to assert that the array has "--option"
and "c=d"
in sequence, so I write this:
assertThat( array ).containsSequence( "--option", "c=d" )
The assertion shouldn't fail because the array does contain that sequence. But it does fail because Arrays.assertContainSequence
assumes that the first occurrence of "--option"
marks the start of the sequence.
Hi, Just to let you know that this issue has been solved in AssertJ core in 1.2.0 release (AssertJ is a fork of Fest Assert). It is not yet solved in Fest (the previous github automatic comment may be confusing).
Regards,
Joel Costigliola