import dshould : equal; import dshould.stringcmp : green, red; import dshould.thrown : throwA; [3, 4].should.contain.exactly([3, 4]); [3, 4].should.contain.exactly([4, 3]); [3, 4].should.contain.exactly([3]).should.throwA!FluentException.where.msg.should.equal( "Test failed: expected exact set of values, but got \n" ~ "[\n" ~ " 3,\n" ~ green("+ 4") ~ "\n" ~ "]"); [3, 4].should.contain.exactly([3, 4, 5]).should.throwA!FluentException.where.msg.should.equal( "Test failed: expected exact set of values, but got \n" ~ "[\n" ~ " 3,\n" ~ " 4,\n" ~ red("- 5") ~ "\n" ~ "]"); [3, 4].should.contain.exactly([3, 5]).should.throwA!FluentException.where.msg.should.equal( "Test failed: expected exact set of values, but got \n" ~ "[\n" ~ " 3,\n" ~ green("+ 4") ~ ",\n" ~ red("- 5") ~ "\n" ~ "]");
The phrase .contain.exactly indicates that two ranges are expected to contain exactly the same elements, but possibly in a different order.