From 201ac63c7692355b07b83034c1813c000ec70e84 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 5 Feb 2020 15:18:14 +0100 Subject: fs.lua: fix error message when source file is missing Fixes #1147. --- spec/fs_spec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index 5d8926c4..16295869 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua @@ -894,7 +894,9 @@ describe("Luarocks fs test #unit", function() it("returns false and does nothing if the source file does not exist", function() srcfile = get_tmp_path() dstfile = get_tmp_path() - assert.falsy(fs.copy(srcfile, dstfile, nil)) + local ok, err = fs.copy(srcfile, dstfile, nil) + assert.falsy(ok) + assert.not_match("are the same file", err) assert.falsy(exists_file(dstfile)) end) -- cgit v1.2.3-55-g6feb