fix: support interfaces in Java and PHP (#183)

Closes #182
This commit is contained in:
Michael Härtl
2024-08-02 16:37:02 +02:00
committed by GitHub
parent f027ac49f6
commit 88698b12c3
6 changed files with 65 additions and 16 deletions

View File

@@ -0,0 +1,35 @@
--- Test cases for emmylua
---
--- @module 'tests.neogen.lua_spec'
local specs = require('tests.utils.specs')
local function make_emmylua(source, type)
return specs.make_docstring(source, 'java', { type = type, annotation_convention = { java = 'javadoc' } })
end
describe("java: javadoc", function()
describe("class", function()
it("works with an basic interface", function()
local source = [[
public interface Entity {
@NonNull UUID getId();|cursor|
}
]]
local expected = [[
/**
* [TODO:description]
*
*/
public interface Entity {
@NonNull UUID getId();
}
]]
local result = make_emmylua(source, "class")
assert.equal(expected, result)
end)
end)
end)