assert(s.contains(if (vid > 0) vid - 1 else 99))

i.e. remove the  { } for one liner if used as ternary operator.