diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-04-19 18:15:22 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-04-19 18:15:22 -0300 |
| commit | 7c09d1c22cf14ff088b9de4ab214164818fba28a (patch) | |
| tree | 64ee8036f817502a846a402d948b02f40b88b4f0 | |
| parent | cd40b4dbd6b73a7740cc48798a7d3ed9c0bcafdd (diff) | |
| download | luarocks-7c09d1c22cf14ff088b9de4ab214164818fba28a.tar.gz luarocks-7c09d1c22cf14ff088b9de4ab214164818fba28a.tar.bz2 luarocks-7c09d1c22cf14ff088b9de4ab214164818fba28a.zip | |
luarocks list: fix regression in display of version numbers
| -rw-r--r-- | spec/list_spec.lua | 7 | ||||
| -rw-r--r-- | src/luarocks/search.lua | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/spec/list_spec.lua b/spec/list_spec.lua index d6aeef38..f11c884d 100644 --- a/spec/list_spec.lua +++ b/spec/list_spec.lua | |||
| @@ -25,10 +25,17 @@ describe("LuaRocks list tests #blackbox #b_list", function() | |||
| 25 | assert.is.truthy(output:find("luacov\t0.11.0-1\tinstalled\t" .. testing_paths.testing_sys_rocks, 1, true)) | 25 | assert.is.truthy(output:find("luacov\t0.11.0-1\tinstalled\t" .. testing_paths.testing_sys_rocks, 1, true)) |
| 26 | end) | 26 | end) |
| 27 | 27 | ||
| 28 | it("LuaRocks list shows version number", function() | ||
| 29 | local output = run.luarocks("list") | ||
| 30 | assert.is.truthy(output:find("luacov")) | ||
| 31 | assert.matches("0.11.0-1", output, 1, true) | ||
| 32 | end) | ||
| 33 | |||
| 28 | it("LuaRocks install outdated and list it", function() | 34 | it("LuaRocks install outdated and list it", function() |
| 29 | assert.is_true(run.luarocks_bool("install say 1.0-1")) | 35 | assert.is_true(run.luarocks_bool("install say 1.0-1")) |
| 30 | local output = run.luarocks("list --outdated") | 36 | local output = run.luarocks("list --outdated") |
| 31 | assert.is.truthy(output:find("say")) | 37 | assert.is.truthy(output:find("say")) |
| 38 | assert.matches("1.0-1 < 1.2-1", output, 1, true) | ||
| 32 | end) | 39 | end) |
| 33 | 40 | ||
| 34 | it("LuaRocks list invalid tree", function() | 41 | it("LuaRocks list invalid tree", function() |
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index 57f39bdc..0edef10a 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua | |||
| @@ -300,6 +300,9 @@ function search.print_result_tree(result_tree, porcelain) | |||
| 300 | end | 300 | end |
| 301 | for key, list in util.sortedpairs(namespaces) do | 301 | for key, list in util.sortedpairs(namespaces) do |
| 302 | util.printout(key == "" and package or key .. "/" .. package) | 302 | util.printout(key == "" and package or key .. "/" .. package) |
| 303 | for _, line in ipairs(list) do | ||
| 304 | util.printout(line) | ||
| 305 | end | ||
| 303 | util.printout() | 306 | util.printout() |
| 304 | end | 307 | end |
| 305 | end | 308 | end |
