diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-16 13:36:26 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2021-03-16 16:32:45 -0300 |
| commit | 8f3ce333e7a1abfc6bf0488817d9eff4a2fd443f (patch) | |
| tree | f05d1a49995341a56e602ce2a3256b89372e9d04 /spec/util_spec.lua | |
| parent | 2b56388e76952be52d849415b1ebae74b6dc4607 (diff) | |
| download | luarocks-8f3ce333e7a1abfc6bf0488817d9eff4a2fd443f.tar.gz luarocks-8f3ce333e7a1abfc6bf0488817d9eff4a2fd443f.tar.bz2 luarocks-8f3ce333e7a1abfc6bf0488817d9eff4a2fd443f.zip | |
editorconfig: trim trailing whitespace
Diffstat (limited to 'spec/util_spec.lua')
| -rw-r--r-- | spec/util_spec.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/util_spec.lua b/spec/util_spec.lua index 3970a57c..5aa49b4c 100644 --- a/spec/util_spec.lua +++ b/spec/util_spec.lua | |||
| @@ -33,7 +33,7 @@ describe("Basic tests #integration", function() | |||
| 33 | local delete_path = lfs.currentdir() | 33 | local delete_path = lfs.currentdir() |
| 34 | assert.is_true(os.remove(delete_path)) | 34 | assert.is_true(os.remove(delete_path)) |
| 35 | 35 | ||
| 36 | local output = run.luarocks("") | 36 | local output = run.luarocks("") |
| 37 | assert.is.falsy(output:find("the Lua package manager")) | 37 | assert.is.falsy(output:find("the Lua package manager")) |
| 38 | assert.is_true(lfs.chdir(main_path)) | 38 | assert.is_true(lfs.chdir(main_path)) |
| 39 | 39 | ||
| @@ -44,7 +44,7 @@ describe("Basic tests #integration", function() | |||
| 44 | it("--timeout", function() | 44 | it("--timeout", function() |
| 45 | assert.is.truthy(run.luarocks("--timeout=10")) | 45 | assert.is.truthy(run.luarocks("--timeout=10")) |
| 46 | end) | 46 | end) |
| 47 | 47 | ||
| 48 | it("--timeout invalid", function() | 48 | it("--timeout invalid", function() |
| 49 | assert.is_false(run.luarocks_bool("--timeout=abc")) | 49 | assert.is_false(run.luarocks_bool("--timeout=abc")) |
| 50 | end) | 50 | end) |
| @@ -61,17 +61,17 @@ local core_util = require("luarocks.core.util") | |||
| 61 | 61 | ||
| 62 | describe("luarocks.util #unit", function() | 62 | describe("luarocks.util #unit", function() |
| 63 | local runner | 63 | local runner |
| 64 | 64 | ||
| 65 | setup(function() | 65 | setup(function() |
| 66 | runner = require("luacov.runner") | 66 | runner = require("luacov.runner") |
| 67 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 67 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 68 | runner.tick = true | 68 | runner.tick = true |
| 69 | end) | 69 | end) |
| 70 | 70 | ||
| 71 | teardown(function() | 71 | teardown(function() |
| 72 | runner.shutdown() | 72 | runner.shutdown() |
| 73 | end) | 73 | end) |
| 74 | 74 | ||
| 75 | describe("util.sortedpairs", function() | 75 | describe("util.sortedpairs", function() |
| 76 | local function collect(iter, state, var) | 76 | local function collect(iter, state, var) |
| 77 | local collected = {} | 77 | local collected = {} |
| @@ -122,30 +122,30 @@ describe("luarocks.util #unit", function() | |||
| 122 | }, {"k3", {"k2", {"sub order"}}, "k1"}))) | 122 | }, {"k3", {"k2", {"sub order"}}, "k1"}))) |
| 123 | end) | 123 | end) |
| 124 | end) | 124 | end) |
| 125 | 125 | ||
| 126 | describe("core.util.show_table", function() | 126 | describe("core.util.show_table", function() |
| 127 | it("returns a pretty-printed string containing the representation of the given table", function() | 127 | it("returns a pretty-printed string containing the representation of the given table", function() |
| 128 | local result | 128 | local result |
| 129 | 129 | ||
| 130 | local t1 = {1, 2, 3} | 130 | local t1 = {1, 2, 3} |
| 131 | result = core_util.show_table(t1) | 131 | result = core_util.show_table(t1) |
| 132 | assert.truthy(result:find("[1] = 1", 1, true)) | 132 | assert.truthy(result:find("[1] = 1", 1, true)) |
| 133 | assert.truthy(result:find("[2] = 2", 1, true)) | 133 | assert.truthy(result:find("[2] = 2", 1, true)) |
| 134 | assert.truthy(result:find("[3] = 3", 1, true)) | 134 | assert.truthy(result:find("[3] = 3", 1, true)) |
| 135 | 135 | ||
| 136 | local t2 = {a = 1, b = 2, c = 3} | 136 | local t2 = {a = 1, b = 2, c = 3} |
| 137 | result = core_util.show_table(t2) | 137 | result = core_util.show_table(t2) |
| 138 | assert.truthy(result:find("[\"a\"] = 1", 1, true)) | 138 | assert.truthy(result:find("[\"a\"] = 1", 1, true)) |
| 139 | assert.truthy(result:find("[\"b\"] = 2", 1, true)) | 139 | assert.truthy(result:find("[\"b\"] = 2", 1, true)) |
| 140 | assert.truthy(result:find("[\"c\"] = 3", 1, true)) | 140 | assert.truthy(result:find("[\"c\"] = 3", 1, true)) |
| 141 | 141 | ||
| 142 | local t3 = {a = 1, b = "2", c = {3}} | 142 | local t3 = {a = 1, b = "2", c = {3}} |
| 143 | result = core_util.show_table(t3) | 143 | result = core_util.show_table(t3) |
| 144 | assert.truthy(result:find("[\"a\"] = 1", 1, true)) | 144 | assert.truthy(result:find("[\"a\"] = 1", 1, true)) |
| 145 | assert.truthy(result:find("[\"b\"] = \"2\"", 1, true)) | 145 | assert.truthy(result:find("[\"b\"] = \"2\"", 1, true)) |
| 146 | assert.truthy(result:find("[\"c\"] = {", 1, true)) | 146 | assert.truthy(result:find("[\"c\"] = {", 1, true)) |
| 147 | assert.truthy(result:find("[1] = 3", 1, true)) | 147 | assert.truthy(result:find("[1] = 3", 1, true)) |
| 148 | 148 | ||
| 149 | local t4 = {a = 1, b = {c = 2, d = {e = "4"}}} | 149 | local t4 = {a = 1, b = {c = 2, d = {e = "4"}}} |
| 150 | result = core_util.show_table(t4) | 150 | result = core_util.show_table(t4) |
| 151 | assert.truthy(result:find("[\"a\"] = 1", 1, true)) | 151 | assert.truthy(result:find("[\"a\"] = 1", 1, true)) |
| @@ -155,7 +155,7 @@ describe("luarocks.util #unit", function() | |||
| 155 | assert.truthy(result:find("[\"e\"] = \"4\"", 1, true)) | 155 | assert.truthy(result:find("[\"e\"] = \"4\"", 1, true)) |
| 156 | end) | 156 | end) |
| 157 | end) | 157 | end) |
| 158 | 158 | ||
| 159 | describe("core.util.cleanup_path", function() | 159 | describe("core.util.cleanup_path", function() |
| 160 | it("does not change order of existing items of prepended path", function() | 160 | it("does not change order of existing items of prepended path", function() |
| 161 | local sys_path = '/usr/local/bin;/usr/bin' | 161 | local sys_path = '/usr/local/bin;/usr/bin' |
