range tests rewritten