add test for TernaryExpression

Yes I was thinking about bs[i] . This need to be fixed please make a bug report and add a comment in the test as of why you do thing to work around limitations.