diff options
| author | V1K1NGbg <victor@ilchev.com> | 2024-08-22 17:48:58 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-10-21 13:30:51 -0300 |
| commit | 2977b60e567922969e54ee19f1fb5115510755f5 (patch) | |
| tree | f9479cae1655535bd5156288610cb796a63590ab /src | |
| parent | b0030995b0c60c0fb88d01d71cdd2d5773c8f321 (diff) | |
| download | luarocks-2977b60e567922969e54ee19f1fb5115510755f5.tar.gz luarocks-2977b60e567922969e54ee19f1fb5115510755f5.tar.bz2 luarocks-2977b60e567922969e54ee19f1fb5115510755f5.zip | |
Teal: convert luarocks.test.busted
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/test/busted.tl (renamed from src/luarocks/test/busted.lua) | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/luarocks/test/busted.lua b/src/luarocks/test/busted.tl index c73909cf..832a81b7 100644 --- a/src/luarocks/test/busted.lua +++ b/src/luarocks/test/busted.tl | |||
| @@ -1,22 +1,24 @@ | |||
| 1 | 1 | ||
| 2 | local busted = {} | 2 | local record busted |
| 3 | end | ||
| 3 | 4 | ||
| 4 | local fs = require("luarocks.fs") | 5 | local fs = require("luarocks.fs") |
| 5 | local deps = require("luarocks.deps") | 6 | local deps = require("luarocks.deps") |
| 6 | local path = require("luarocks.path") | 7 | local path = require("luarocks.path") |
| 7 | local dir = require("luarocks.dir") | 8 | local dir = require("luarocks.dir") |
| 8 | local queries = require("luarocks.queries") | 9 | local queries = require("luarocks.queries") |
| 10 | local install = require("luarocks.cmd.install") | ||
| 9 | 11 | ||
| 10 | local unpack = table.unpack or unpack | 12 | local type Test = require("luarocks.core.types.rockspec").Test |
| 11 | 13 | ||
| 12 | function busted.detect_type() | 14 | function busted.detect_type(): boolean |
| 13 | if fs.exists(".busted") then | 15 | if fs.exists(".busted") then |
| 14 | return true | 16 | return true |
| 15 | end | 17 | end |
| 16 | return false | 18 | return false |
| 17 | end | 19 | end |
| 18 | 20 | ||
| 19 | function busted.run_tests(test, args) | 21 | function busted.run_tests(test: Test, args: {string}): boolean, string |
| 20 | if not test then | 22 | if not test then |
| 21 | test = {} | 23 | test = {} |
| 22 | end | 24 | end |
| @@ -26,7 +28,7 @@ function busted.run_tests(test, args) | |||
| 26 | return nil, bustedver | 28 | return nil, bustedver |
| 27 | end | 29 | end |
| 28 | 30 | ||
| 29 | local busted_exe | 31 | local busted_exe: string |
| 30 | if test.busted_executable then | 32 | if test.busted_executable then |
| 31 | busted_exe = test.busted_executable | 33 | busted_exe = test.busted_executable |
| 32 | else | 34 | else |
| @@ -40,8 +42,8 @@ function busted.run_tests(test, args) | |||
| 40 | end | 42 | end |
| 41 | end | 43 | end |
| 42 | 44 | ||
| 43 | local err | 45 | local err: string |
| 44 | ok, err = fs.execute(busted_exe, unpack(args)) | 46 | ok, err = fs.execute(busted_exe, table.unpack(args)) |
| 45 | if ok then | 47 | if ok then |
| 46 | return true | 48 | return true |
| 47 | else | 49 | else |
