diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-20 10:45:09 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 15:51:13 -0300 |
| commit | 5de72a61610f451ca45b4f8eedd9b9539571dca5 (patch) | |
| tree | 278137615a75fba082beb3ac358a9a9be60e9e8a /spec/fs_spec.lua | |
| parent | 4c1c170b9d344b6c069c8e6df5798f6e0bd63966 (diff) | |
| download | luarocks-5de72a61610f451ca45b4f8eedd9b9539571dca5.tar.gz luarocks-5de72a61610f451ca45b4f8eedd9b9539571dca5.tar.bz2 luarocks-5de72a61610f451ca45b4f8eedd9b9539571dca5.zip | |
Tests: minor cleanups
Diffstat (limited to 'spec/fs_spec.lua')
| -rw-r--r-- | spec/fs_spec.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index 3f115df9..08923f37 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua | |||
| @@ -789,7 +789,7 @@ describe("Luarocks fs test #unit", function() | |||
| 789 | create_file(srcfile, srccontent) | 789 | create_file(srcfile, srccontent) |
| 790 | dstfile = get_tmp_path() | 790 | dstfile = get_tmp_path() |
| 791 | assert.truthy(fs.copy(srcfile, dstfile)) | 791 | assert.truthy(fs.copy(srcfile, dstfile)) |
| 792 | fd = assert(io.open(dstfile, "r")) | 792 | local fd = assert(io.open(dstfile, "r")) |
| 793 | local dstcontent = fd:read("*a") | 793 | local dstcontent = fd:read("*a") |
| 794 | assert.same("foo", dstcontent) | 794 | assert.same("foo", dstcontent) |
| 795 | if posix_ok then | 795 | if posix_ok then |
| @@ -802,7 +802,7 @@ describe("Luarocks fs test #unit", function() | |||
| 802 | create_file(srcfile, srccontent) | 802 | create_file(srcfile, srccontent) |
| 803 | dstfile = get_tmp_path() | 803 | dstfile = get_tmp_path() |
| 804 | assert.truthy(fs.copy(srcfile, dstfile, "exec")) | 804 | assert.truthy(fs.copy(srcfile, dstfile, "exec")) |
| 805 | fd = assert(io.open(dstfile, "r")) | 805 | local fd = assert(io.open(dstfile, "r")) |
| 806 | local dstcontent = fd:read("*a") | 806 | local dstcontent = fd:read("*a") |
| 807 | assert.same("foo", dstcontent) | 807 | assert.same("foo", dstcontent) |
| 808 | end) | 808 | end) |
| @@ -1060,7 +1060,7 @@ describe("Luarocks fs test #unit", function() | |||
| 1060 | assert.truthy(fs.move(srcfile, dstfile)) | 1060 | assert.truthy(fs.move(srcfile, dstfile)) |
| 1061 | assert.truthy(fs.exists(dstfile)) | 1061 | assert.truthy(fs.exists(dstfile)) |
| 1062 | assert.falsy(fs.exists(srcfile)) | 1062 | assert.falsy(fs.exists(srcfile)) |
| 1063 | fd = assert(io.open(dstfile, "r")) | 1063 | local fd = assert(io.open(dstfile, "r")) |
| 1064 | local dstcontents = assert(fd:read("*a")) | 1064 | local dstcontents = assert(fd:read("*a")) |
| 1065 | assert.same(dstcontents, "foo") | 1065 | assert.same(dstcontents, "foo") |
| 1066 | if posix_ok then | 1066 | if posix_ok then |
| @@ -1075,7 +1075,7 @@ describe("Luarocks fs test #unit", function() | |||
| 1075 | assert.truthy(fs.move(srcfile, dstfile, "read")) | 1075 | assert.truthy(fs.move(srcfile, dstfile, "read")) |
| 1076 | assert.truthy(fs.exists(dstfile)) | 1076 | assert.truthy(fs.exists(dstfile)) |
| 1077 | assert.falsy(fs.exists(srcfile)) | 1077 | assert.falsy(fs.exists(srcfile)) |
| 1078 | fd = assert(io.open(dstfile, "r")) | 1078 | local fd = assert(io.open(dstfile, "r")) |
| 1079 | local dstcontents = assert(fd:read("*a")) | 1079 | local dstcontents = assert(fd:read("*a")) |
| 1080 | assert.same(dstcontents, "foo") | 1080 | assert.same(dstcontents, "foo") |
| 1081 | end) | 1081 | end) |
| @@ -1093,7 +1093,7 @@ describe("Luarocks fs test #unit", function() | |||
| 1093 | create_file(dstfile, "bar") | 1093 | create_file(dstfile, "bar") |
| 1094 | assert.falsy(fs.move(srcfile, dstfile)) | 1094 | assert.falsy(fs.move(srcfile, dstfile)) |
| 1095 | assert.truthy(fs.exists(srcfile)) | 1095 | assert.truthy(fs.exists(srcfile)) |
| 1096 | fd = assert(io.open(dstfile, "r")) | 1096 | local fd = assert(io.open(dstfile, "r")) |
| 1097 | local dstcontents = assert(fd:read("*a")) | 1097 | local dstcontents = assert(fd:read("*a")) |
| 1098 | assert.same(dstcontents, "bar") | 1098 | assert.same(dstcontents, "bar") |
| 1099 | end) | 1099 | end) |
