bool TestExtMemcached::test_Memcached_cas() {
  CREATE_MEMCACHED();
  for (ArrayIter iter(memc_version); iter; ++iter) {
    if (!f_version_compare(iter.second().toString(), "1.3.0", ">=")) {
      SKIP("Need memcached 1.3.0 for CAS");
      return Count(true);
    }
  }

  const char *key = "cas_test";

  VERIFY(memc->t_set(key, 10, EXPIRATION));

  Variant cas;

  VS(memc->t_get(key, null, strongBind(cas)), 10);

  VERIFY(!cas.isNull() && cas.isDouble());
  VERIFY(memc->t_cas(cas.toDouble(), key, 11, EXPIRATION));

  VS(memc->t_get(key, null, cas), 11);
  VERIFY(!memc->t_cas(cas.toDouble(), key, 12, EXPIRATION));
  VS(memc->t_get(key, null, cas), 11);

  return Count(true);
}
bool TestExtOptions::test_version_compare() {
  VERIFY(!f_version_compare("1.3.0.dev", "1.1.2", "<"));
  return Count(true);
}