File: distributed_commands_on_hyper_log_log_test.rb

package info (click to toggle)
ruby-redis 3.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 736 kB
  • ctags: 1,128
  • sloc: ruby: 8,149; makefile: 5
file content (33 lines) | stat: -rw-r--r-- 735 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# encoding: UTF-8

require File.expand_path("helper", File.dirname(__FILE__))
require "lint/hyper_log_log"

class TestDistributedCommandsOnHyperLogLog < Test::Unit::TestCase

  include Helper::Distributed
  include Lint::HyperLogLog

  def test_pfmerge
    target_version "2.8.9" do
      assert_raise Redis::Distributed::CannotDistribute do
        r.pfadd "foo", "s1"
        r.pfadd "bar", "s2"

        assert r.pfmerge("res", "foo", "bar")
      end
    end
  end

  def test_pfcount_multiple_keys_diff_nodes
    target_version "2.8.9" do
      assert_raise Redis::Distributed::CannotDistribute do
        r.pfadd "foo", "s1"
        r.pfadd "bar", "s2"

        assert r.pfcount("res", "foo", "bar")
      end
    end
  end

end