use diag instead of print, move ok() statements out of expect expressions