cargo_test.lua

 1query = [[(
 2    (attribute_item
 3        (meta_item
 4            (identifier) @test)) @attribute
 5    .
 6    (function_item
 7        name: (identifier) @name) @funciton
 8)]]
 9
10function run_test(name)
11    local command = 'cargo test -- ' .. name
12    local openPop = assert(io.popen(command, 'r'))
13    local output = openPop:read('*all')
14    openPop:close()
15    return output
16end