Modernize restrict test