Skip to content

Commit

Permalink
fix: handle quoted test names (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
rudiejd authored Jan 19, 2025
1 parent c5067bc commit 0e56bc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/neotest-elixir/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ local function clean_name(name)
name = name:gsub('^"', ""):gsub('"$', "")
end

-- Replace escaped quotes with literal quotes
name = name:gsub('\\"', '"')

if vim.startswith(name, "\n ") then
name = remove_heredoc_prefix(name:sub(2))
end
Expand Down
4 changes: 4 additions & 0 deletions tests/sample_proj/test/sample_proj/parse_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ defmodule SampleProj.ParseTest do
assert SampleProj.hello() == :world
end

test "with a \"quoted text\"" do
assert SampleProj.hello() == :world
end

test "multiline
test" do
assert SampleProj.hello() == :world
Expand Down

0 comments on commit 0e56bc7

Please sign in to comment.