Sha256: 83712b8fce7e134579f0d14ec610f8860a2eb1e4f4c1d112fd8717e4d2ea32c2

Contents?: true

Size: 1.41 KB

Versions: 21

Compression:

Stored size: 1.41 KB

Contents

module Lint

  module HyperLogLog

    def test_pfadd
      target_version "2.8.9" do
        assert_equal true, r.pfadd("foo", "s1")
        assert_equal true, r.pfadd("foo", "s2")
        assert_equal false, r.pfadd("foo", "s1")

        assert_equal 2, r.pfcount("foo")
      end
    end

    def test_variadic_pfadd
      target_version "2.8.9" do
        assert_equal true, r.pfadd("foo", ["s1", "s2"])
        assert_equal true, r.pfadd("foo", ["s1", "s2", "s3"])

        assert_equal 3, r.pfcount("foo")
      end
    end

    def test_pfcount
      target_version "2.8.9" do
        assert_equal 0, r.pfcount("foo")

        assert_equal true, r.pfadd("foo", "s1")

        assert_equal 1, r.pfcount("foo")
      end
    end

    def test_variadic_pfcount
      target_version "2.8.9" do
        assert_equal 0, r.pfcount(["{1}foo", "{1}bar"])

        assert_equal true, r.pfadd("{1}foo", "s1")
        assert_equal true, r.pfadd("{1}bar", "s1")
        assert_equal true, r.pfadd("{1}bar", "s2")

        assert_equal 2, r.pfcount("{1}foo", "{1}bar")
      end
    end

    def test_variadic_pfcount_expanded
      target_version "2.8.9" do
        assert_equal 0, r.pfcount("{1}foo", "{1}bar")

        assert_equal true, r.pfadd("{1}foo", "s1")
        assert_equal true, r.pfadd("{1}bar", "s1")
        assert_equal true, r.pfadd("{1}bar", "s2")

        assert_equal 2, r.pfcount("{1}foo", "{1}bar")
      end
    end

  end

end

Version data entries

21 entries across 20 versions & 7 rubygems

Version Path
finsync_redis-3.3.5 test/lint/hyper_log_log.rb
redis-4.0.2 test/lint/hyper_log_log.rb
redis-3.3.5 test/lint/hyper_log_log.rb
redis-4.0.1 test/lint/hyper_log_log.rb
redis-4.0.0 test/lint/hyper_log_log.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/lint/hyper_log_log.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/lint/hyper_log_log.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/lint/hyper_log_log.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/test/lint/hyper_log_log.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/test/lint/hyper_log_log.rb
redis-3.3.3 test/lint/hyper_log_log.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/test/lint/hyper_log_log.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/test/lint/hyper_log_log.rb
redis-3.3.2 test/lint/hyper_log_log.rb
redis-3.3.1 test/lint/hyper_log_log.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/test/lint/hyper_log_log.rb
redis-3.3.0 test/lint/hyper_log_log.rb
discourse-redis-3.2.2 test/lint/hyper_log_log.rb
redis-3.2.2 test/lint/hyper_log_log.rb
redis-3.2.1 test/lint/hyper_log_log.rb