test validation logic