|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +require 'spec_helper' |
| 4 | + |
| 5 | +describe 'transforms ctags output' do |
| 6 | + it "generates trace file" do |
| 7 | + correct_content = <<~EOF |
| 8 | +Server /tmp/v3hvNb9/5.ex /^defmodule PusherProxy.Proxy.Server do$/;" m line:3 |
| 9 | +start_link/2 /tmp/v3hvNb9/5.ex /^ def start_link(name, kw_args\\\\[]) do$/;" f line:59 |
| 10 | +add_worker/2 /tmp/v3hvNb9/5.ex /^ def add_worker(pid, worker_pid) do$/;" f line:63 |
| 11 | +add_worker/3 /tmp/v3hvNb9/5.ex /^ def add_worker(pid, worker_pid, options) do$/;" f line:66 |
| 12 | +more_work_available?/3 /tmp/v3hvNb9/5.ex /^ def more_work_available?(pid, worker_pid, since_rev_id) do$/;" f line:68 |
| 13 | +init(kw_args) /tmp/v3hvNb9/5.ex /^ def init(kw_args) do$/;" O line:73 |
| 14 | +handle_cast({:add_worker, pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:add_worker, pid}, state) do$/;" O line:86 |
| 15 | +handle_cast({:decoder_ready, decoder_pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:decoder_ready, decoder_pid}, state) do$/;" O line:101 |
| 16 | +handle_cast({:data, _data, false, _rev, _pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:data, _data, false, _rev, _pid}, state) do$/;" O line:126 |
| 17 | +handle_cast({:data, data, true, _rev, _pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:data, data, true, _rev, _pid}, state) do$/;" O line:141 |
| 18 | +handle_cast({:more_work_available?, worker_pid, known_max_rev}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:more_work_available?, worker_pid, known_max_rev}, state) do$/;" O line:172 |
| 19 | +handle_cast(:cleanup_ets, state) /tmp/v3hvNb9/5.ex /^ def handle_cast(:cleanup_ets, state) do$/;" O line:188 |
| 20 | +handle_info({:DOWN, _, :process, pid, reason}, state) /tmp/v3hvNb9/5.ex /^ def handle_info({:DOWN, _, :process, pid, reason}, state) do$/;" O line:208 |
| 21 | +handle_info(ev, state) /tmp/v3hvNb9/5.ex /^ def handle_info(ev, state) do$/;" O line:219 |
| 22 | +EOF |
| 23 | + |
| 24 | + |
| 25 | + expect(<<~EOF).to be_ctags_output(correct_content) |
| 26 | +Server /tmp/v3hvNb9/5.ex /^defmodule PusherProxy.Proxy.Server do$/;" m line:3 |
| 27 | +start_link /tmp/v3hvNb9/5.ex /^ def start_link(name, kw_args\\\\[]) do$/;" f line:59 |
| 28 | +add_worker /tmp/v3hvNb9/5.ex /^ def add_worker(pid, worker_pid) do$/;" f line:63 |
| 29 | +add_worker /tmp/v3hvNb9/5.ex /^ def add_worker(pid, worker_pid1) do$/;" f line:64 |
| 30 | +add_worker /tmp/v3hvNb9/5.ex /^ def add_worker(pid, worker_pid2) do$/;" f line:65 |
| 31 | +add_worker /tmp/v3hvNb9/5.ex /^ def add_worker(pid, worker_pid, options) do$/;" f line:66 |
| 32 | +more_work_available? /tmp/v3hvNb9/5.ex /^ def more_work_available?(pid, worker_pid, since_rev_id) do$/;" f line:68 |
| 33 | +init(kw_args) /tmp/v3hvNb9/5.ex /^ def init(kw_args) do$/;" O line:73 |
| 34 | +init /tmp/v3hvNb9/5.ex /^ def init(kw_args) do$/;" f line:73 |
| 35 | +handle_cast({:add_worker, pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:add_worker, pid}, state) do$/;" O line:86 |
| 36 | +handle_cast /tmp/v3hvNb9/5.ex /^ def handle_cast({:add_worker, pid}, state) do$/;" f line:86 |
| 37 | +handle_cast({:decoder_ready, decoder_pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:decoder_ready, decoder_pid}, state) do$/;" O line:101 |
| 38 | +handle_cast /tmp/v3hvNb9/5.ex /^ def handle_cast({:decoder_ready, decoder_pid}, state) do$/;" f line:101 |
| 39 | +handle_cast({:data, _data, false, _rev, _pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:data, _data, false, _rev, _pid}, state) do$/;" O line:126 |
| 40 | +handle_cast /tmp/v3hvNb9/5.ex /^ def handle_cast({:data, _data, false, _rev, _pid}, state) do$/;" f line:126 |
| 41 | +handle_cast({:data, data, true, _rev, _pid}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:data, data, true, _rev, _pid}, state) do$/;" O line:141 |
| 42 | +handle_cast /tmp/v3hvNb9/5.ex /^ def handle_cast({:data, data, true, _rev, _pid}, state) do$/;" f line:141 |
| 43 | +handle_cast({:more_work_available?, worker_pid, known_max_rev}, state) /tmp/v3hvNb9/5.ex /^ def handle_cast({:more_work_available?, worker_pid, known_max_rev}, state) do$/;" O line:172 |
| 44 | +handle_cast /tmp/v3hvNb9/5.ex /^ def handle_cast({:more_work_available?, worker_pid, known_max_rev}, state) do$/;" f line:172 |
| 45 | +handle_cast(:cleanup_ets, state) /tmp/v3hvNb9/5.ex /^ def handle_cast(:cleanup_ets, state) do$/;" O line:188 |
| 46 | +handle_cast /tmp/v3hvNb9/5.ex /^ def handle_cast(:cleanup_ets, state) do$/;" f line:188 |
| 47 | +handle_info({:DOWN, _, :process, pid, reason}, state) /tmp/v3hvNb9/5.ex /^ def handle_info({:DOWN, _, :process, pid, reason}, state) do$/;" O line:208 |
| 48 | +handle_info /tmp/v3hvNb9/5.ex /^ def handle_info({:DOWN, _, :process, pid, reason}, state) do$/;" f line:208 |
| 49 | +handle_info(ev, state) /tmp/v3hvNb9/5.ex /^ def handle_info(ev, state) do$/;" O line:219 |
| 50 | +handle_info /tmp/v3hvNb9/5.ex /^ def handle_info(ev, state) do$/;" f line:219 |
| 51 | +EOF |
| 52 | + end |
| 53 | +end |
0 commit comments