void test_hscan(client &c) { c.flushdb(); std::set<std::string> expected; for (int i=42; i<442; i++) { std::string k("key"); k+=boost::lexical_cast<std::string>(i); std::string v("key"); v+=boost::lexical_cast<std::string>(i); c.hset("myhash", k, v); expected.insert(k); } std::set<std::string> keys; for(auto i=c.hscan("myhash"); i!=c.end(); ++i) { keys.insert(*i); } assert(keys==expected); }