Skip to content

Commit 0e56bc7

Browse files
authored
fix: handle quoted test names (#46)
1 parent c5067bc commit 0e56bc7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lua/neotest-elixir/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ local function clean_name(name)
133133
name = name:gsub('^"', ""):gsub('"$', "")
134134
end
135135

136+
-- Replace escaped quotes with literal quotes
137+
name = name:gsub('\\"', '"')
138+
136139
if vim.startswith(name, "\n ") then
137140
name = remove_heredoc_prefix(name:sub(2))
138141
end

tests/sample_proj/test/sample_proj/parse_test.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ defmodule SampleProj.ParseTest do
3535
assert SampleProj.hello() == :world
3636
end
3737

38+
test "with a \"quoted text\"" do
39+
assert SampleProj.hello() == :world
40+
end
41+
3842
test "multiline
3943
test" do
4044
assert SampleProj.hello() == :world

0 commit comments

Comments
 (0)