Annotate

spec/util_indexedbheap_spec.lua @ 11056:0b0a42542456

util.jid: Fix special escaping of '\' per XEP-0106 From XEP-0106 §2. Requirements: > in certain circumstances, the escaping character itself ("\") might > also be escaped Later in §4.2 Address Transformation Algorithm it is stated that the backslash would only be escaped if it forms an escape sequence. Thus '\foo' is unaltered but '\20' must be escaped into '\5c20'. Thanks to lovetox and jonas’ for brining up.
author Kim Alvefur <zash@zash.se>
date Fri, 28 Aug 2020 18:44:02 +0200
parent 10998:f3fc0f799dc4
child 11116:d334f2bebe55
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10998
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 local ibh = require"util.indexedbheap";
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 local h
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 setup(function ()
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 h = ibh.create();
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 end)
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 describe("util.indexedbheap", function ()
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7 pending("item can be moved from end to top", function ()
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 h:insert("a", 1);
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9 h:insert("b", 2);
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 h:insert("c", 3);
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 local id = h:insert("*", 10);
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 h:reprioritize(id, 0);
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 assert.same({ 0, "*", id }, { h:pop() });
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 end)
f3fc0f799dc4 util.indexedbheap: Add failing test case for #1572
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 end);