copied range test from node-lazy