Add tests for `while let`

Closes #17687