fest-assert-2.x icon indicating copy to clipboard operation
fest-assert-2.x copied to clipboard

Arrays.assertContainsSequence stops after 1st potential match

Open dloose opened this issue 11 years ago • 1 comments

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.

dloose avatar Apr 18 '13 15:04 dloose

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

joel-costigliola avatar May 12 '13 18:05 joel-costigliola