Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 85 lines (67 sloc) 1.646 kB
a9cc7c4 @cyx Port all contest tests to cutest.
cyx authored
1 # encoding: UTF-8
2
3 require File.expand_path("./helper", File.dirname(__FILE__))
4 require "redis/distributed"
5
6 setup do
7 log = StringIO.new
8 init Redis::Distributed.new(NODES, :logger => ::Logger.new(log))
9 end
10
11 load './test/lint/sets.rb'
12
13 test "SMOVE" do |r|
14 assert_raise Redis::Distributed::CannotDistribute do
15 r.sadd "foo", "s1"
16 r.sadd "bar", "s2"
17
18 r.smove("foo", "bar", "s1")
19 end
20 end
21
22 test "SINTER" do |r|
23 assert_raise Redis::Distributed::CannotDistribute do
24 r.sadd "foo", "s1"
25 r.sadd "foo", "s2"
26 r.sadd "bar", "s2"
27
28 r.sinter("foo", "bar")
29 end
30 end
31
32 test "SINTERSTORE" do |r|
33 assert_raise Redis::Distributed::CannotDistribute do
34 r.sadd "foo", "s1"
35 r.sadd "foo", "s2"
36 r.sadd "bar", "s2"
37
38 r.sinterstore("baz", "foo", "bar")
39 end
40 end
41
42 test "SUNION" do |r|
43 assert_raise Redis::Distributed::CannotDistribute do
44 r.sadd "foo", "s1"
45 r.sadd "foo", "s2"
46 r.sadd "bar", "s2"
47 r.sadd "bar", "s3"
48
49 r.sunion("foo", "bar")
50 end
51 end
52
53 test "SUNIONSTORE" do |r|
54 assert_raise Redis::Distributed::CannotDistribute do
55 r.sadd "foo", "s1"
56 r.sadd "foo", "s2"
57 r.sadd "bar", "s2"
58 r.sadd "bar", "s3"
59
60 r.sunionstore("baz", "foo", "bar")
61 end
62 end
63
64 test "SDIFF" do |r|
65 assert_raise Redis::Distributed::CannotDistribute do
66 r.sadd "foo", "s1"
67 r.sadd "foo", "s2"
68 r.sadd "bar", "s2"
69 r.sadd "bar", "s3"
70
71 r.sdiff("foo", "bar")
72 end
73 end
74
75 test "SDIFFSTORE" do |r|
76 assert_raise Redis::Distributed::CannotDistribute do
77 r.sadd "foo", "s1"
78 r.sadd "foo", "s2"
79 r.sadd "bar", "s2"
80 r.sadd "bar", "s3"
81
82 r.sdiffstore("baz", "foo", "bar")
83 end
84 end
Something went wrong with that request. Please try again.