From b4cbf29d302de4793841427011ec7b04ef7f1479 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 26 Sep 2018 10:19:03 -0300 Subject: Tests: add shebang test for fs.is_lua --- spec/fs_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index 3ed22fbe..a9a34a41 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua @@ -1126,6 +1126,12 @@ describe("Luarocks fs test #unit", function() create_file(tmpfile, "print(\"foo\")") assert.truthy(fs.is_lua(tmpfile)) end) + + it("returns true if the argument is a valid lua script with shebang", function() + tmpfile = get_tmp_path() + create_file(tmpfile, "#!/usr/bin/env lua\n\nprint(\"foo\")") + assert.truthy(fs.is_lua(tmpfile)) + end) it("returns false if the argument is not a valid lua script", function() tmpfile = os.tmpname() -- cgit v1.2.3-55-g6feb