(tmp_path)
| 15 | |
| 16 | |
| 17 | def test_lua(tmp_path): # pragma: win32 no cover |
| 18 | rockspec = '''\ |
| 19 | package = "hello" |
| 20 | version = "dev-1" |
| 21 | |
| 22 | source = { |
| 23 | url = "git+ssh://git@github.com/pre-commit/pre-commit.git" |
| 24 | } |
| 25 | description = {} |
| 26 | dependencies = {} |
| 27 | build = { |
| 28 | type = "builtin", |
| 29 | modules = {}, |
| 30 | install = { |
| 31 | bin = {"bin/hello-world-lua"} |
| 32 | }, |
| 33 | } |
| 34 | ''' |
| 35 | hello_world_lua = '''\ |
| 36 | #!/usr/bin/env lua |
| 37 | print('hello world') |
| 38 | ''' |
| 39 | tmp_path.joinpath('hello-dev-1.rockspec').write_text(rockspec) |
| 40 | bin_dir = tmp_path.joinpath('bin') |
| 41 | bin_dir.mkdir() |
| 42 | bin_file = bin_dir.joinpath('hello-world-lua') |
| 43 | bin_file.write_text(hello_world_lua) |
| 44 | make_executable(bin_file) |
| 45 | |
| 46 | expected = (0, b'hello world\n') |
| 47 | assert run_language(tmp_path, lua, 'hello-world-lua') == expected |
| 48 | |
| 49 | |
| 50 | def test_lua_additional_dependencies(tmp_path): # pragma: win32 no cover |
nothing calls this directly
no test coverage detected