Correct assert and add with_items test

Correct msg assertion and add a test for issue#5965 that uses `with_items`