diff options
| -rw-r--r-- | spec/unit/util_spec.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/unit/util_spec.lua b/spec/unit/util_spec.lua index 8b234b2e..84b335b7 100644 --- a/spec/unit/util_spec.lua +++ b/spec/unit/util_spec.lua | |||
| @@ -83,14 +83,26 @@ describe("luarocks.util #unit", function() | |||
| 83 | assert.are.same({}, collect(util.sortedpairs({}, {"k1", "k2"}))) | 83 | assert.are.same({}, collect(util.sortedpairs({}, {"k1", "k2"}))) |
| 84 | assert.are.same({ | 84 | assert.are.same({ |
| 85 | {"k3", "v3"}, | 85 | {"k3", "v3"}, |
| 86 | {"k2", "v2", {"sub order"}}, | ||
| 87 | {"k1", "v1"}, | 86 | {"k1", "v1"}, |
| 87 | {"k2", "v2"}, | ||
| 88 | {"k4", "v4"}, | 88 | {"k4", "v4"}, |
| 89 | {"k5", "v5"}, | 89 | {"k5", "v5"}, |
| 90 | }, collect(util.sortedpairs({ | 90 | }, collect(util.sortedpairs({ |
| 91 | k1 = "v1", k2 = "v2", k3 = "v3", k4 = "v4", k5 = "v5" | 91 | k1 = "v1", k2 = "v2", k3 = "v3", k4 = "v4", k5 = "v5" |
| 92 | }, {"k3", {"k2", {"sub order"}}, "k1"}))) | 92 | }, {"k3", {"k2", {"sub order"}}, "k1"}))) |
| 93 | end) | 93 | end) |
| 94 | -- it("sort by priority table", function() | ||
| 95 | -- assert.are.same({}, collect(util.sortedpairs({}, {"k1", "k2"}))) | ||
| 96 | -- assert.are.same({ | ||
| 97 | -- {"k3", "v3"}, | ||
| 98 | -- {"k2", "v2", {"sub order"}}, | ||
| 99 | -- {"k1", "v1"}, | ||
| 100 | -- {"k4", "v4"}, | ||
| 101 | -- {"k5", "v5"}, | ||
| 102 | -- }, collect(util.sortedpairs({ | ||
| 103 | -- k1 = "v1", k2 = "v2", k3 = "v3", k4 = "v4", k5 = "v5" | ||
| 104 | -- }, {"k3", {"k2", {"sub order"}}, "k1"}))) | ||
| 105 | -- end) | ||
| 94 | end) | 106 | end) |
| 95 | 107 | ||
| 96 | describe("core.util.show_table", function() | 108 | describe("core.util.show_table", function() |
