Adding test for random generating pattern