aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_util_cache.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-06 16:05:57 +0100
committerKim Alvefur <zash@zash.se>2017-03-06 16:05:57 +0100
commit6403594a10e820f81e9bdffed95d947b7350cca9 (patch)
tree5a6ccfcd8d9fb6e2f2d1d35910732fba43e61132 /tests/test_util_cache.lua
parent367037154898857cf54466a6b5eb8889f04006cb (diff)
parent66618bf09cc664d9375bf41174297714782b4346 (diff)
downloadprosody-6403594a10e820f81e9bdffed95d947b7350cca9.tar.gz
prosody-6403594a10e820f81e9bdffed95d947b7350cca9.zip
Merge 0.10->trunk
Diffstat (limited to 'tests/test_util_cache.lua')
-rw-r--r--tests/test_util_cache.lua34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/test_util_cache.lua b/tests/test_util_cache.lua
index a5e25e75..4240c433 100644
--- a/tests/test_util_cache.lua
+++ b/tests/test_util_cache.lua
@@ -10,7 +10,7 @@ function new(new)
expect_kv(nil, nil, c:tail());
assert_equal(c:count(), 0);
-
+
c:set("one", 1)
assert_equal(c:count(), 1);
expect_kv("one", 1, c:head());
@@ -29,12 +29,12 @@ function new(new)
assert_equal(c:count(), 5);
expect_kv("five", 5, c:head());
expect_kv("one", 1, c:tail());
-
+
c:set("foo", nil);
assert_equal(c:count(), 5);
expect_kv("five", 5, c:head());
expect_kv("one", 1, c:tail());
-
+
assert_equal(c:get("one"), 1);
expect_kv("five", 5, c:head());
expect_kv("one", 1, c:tail());
@@ -46,32 +46,32 @@ function new(new)
assert_equal(c:get("foo"), nil);
assert_equal(c:get("bar"), nil);
-
+
c:set("six", 6);
assert_equal(c:count(), 5);
expect_kv("six", 6, c:head());
expect_kv("two", 2, c:tail());
-
+
assert_equal(c:get("one"), nil);
assert_equal(c:get("two"), 2);
assert_equal(c:get("three"), 3);
assert_equal(c:get("four"), 4);
assert_equal(c:get("five"), 5);
assert_equal(c:get("six"), 6);
-
+
c:set("three", nil);
assert_equal(c:count(), 4);
-
+
assert_equal(c:get("one"), nil);
assert_equal(c:get("two"), 2);
assert_equal(c:get("three"), nil);
assert_equal(c:get("four"), 4);
assert_equal(c:get("five"), 5);
assert_equal(c:get("six"), 6);
-
+
c:set("seven", 7);
assert_equal(c:count(), 5);
-
+
assert_equal(c:get("one"), nil);
assert_equal(c:get("two"), 2);
assert_equal(c:get("three"), nil);
@@ -79,10 +79,10 @@ function new(new)
assert_equal(c:get("five"), 5);
assert_equal(c:get("six"), 6);
assert_equal(c:get("seven"), 7);
-
+
c:set("eight", 8);
assert_equal(c:count(), 5);
-
+
assert_equal(c:get("one"), nil);
assert_equal(c:get("two"), nil);
assert_equal(c:get("three"), nil);
@@ -91,10 +91,10 @@ function new(new)
assert_equal(c:get("six"), 6);
assert_equal(c:get("seven"), 7);
assert_equal(c:get("eight"), 8);
-
+
c:set("four", 4);
assert_equal(c:count(), 5);
-
+
assert_equal(c:get("one"), nil);
assert_equal(c:get("two"), nil);
assert_equal(c:get("three"), nil);
@@ -103,10 +103,10 @@ function new(new)
assert_equal(c:get("six"), 6);
assert_equal(c:get("seven"), 7);
assert_equal(c:get("eight"), 8);
-
+
c:set("nine", 9);
assert_equal(c:count(), 5);
-
+
assert_equal(c:get("one"), nil);
assert_equal(c:get("two"), nil);
assert_equal(c:get("three"), nil);
@@ -268,7 +268,7 @@ function new(new)
local c4 = new(3, false);
-
+
assert_equal(c4:set("a", 1), true);
assert_equal(c4:set("a", 1), true);
assert_equal(c4:set("a", 1), true);
@@ -290,7 +290,7 @@ function new(new)
end
return false;
end);
-
+
assert_equal(c5:set("a", 1), true);
assert_equal(c5:set("a", 1), true);
assert_equal(c5:set("a", 1), true);