-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
### v0.3.3 2017.08.05 | ||
|
||
- 使用严格的路由节点id策略,避免潜在冲突 | ||
|
||
|
||
### v0.3.2 2017.06.10 | ||
|
||
- 关于内置session插件的更改 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
return "0.3.2" | ||
return "0.3.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
before_each(function() | ||
Trie = require("lor.lib.trie") | ||
t = Trie:new() | ||
end) | ||
|
||
after_each(function() | ||
t = nil | ||
end) | ||
|
||
function table_size(t) | ||
local res = 0 | ||
if t then | ||
for _ in pairs(t) do | ||
res = res + 1 | ||
end | ||
end | ||
return res | ||
end | ||
|
||
describe("node is should be unique", function() | ||
it("test case 1", function() | ||
local count = 100 | ||
local nodes = {} | ||
for i=1,count,1 do | ||
local node = t:add_node(tostring(i)) | ||
table.insert(nodes, node) | ||
end | ||
|
||
assert.is.equals(count, #nodes) | ||
assert.is.equals(count, table_size(nodes)) | ||
|
||
local node_map = {} | ||
for i=1,count,1 do | ||
node_map[nodes[i].id] = true | ||
end | ||
assert.is.equals(count, table_size(node_map)) | ||
end) | ||
end) |