test ranging function