cargo_test.lua
1print("initializing plugin...")
2
3query = [[(
4 (attribute_item
5 (meta_item
6 (identifier) @test)) @attribute
7 .
8 (function_item
9 name: (identifier) @name) @funciton
10)]]
11
12function run_test(name)
13 print('running test `' .. name .. '`:')
14 local command = 'cargo test -- ' .. name
15 local openPop = assert(io.popen(command, 'r'))
16 local output = openPop:read('*all')
17 openPop:close()
18 print('done running test')
19 return output
20end
21
22print("done initializing plugin.")