Skip to content

Commit 41ec7d8

Browse files
committed
Add test for modules that return functions
Only for EmmyLua, LuaLs don't export these
1 parent ebc895e commit 41ec7d8

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

test/roots/test-autodoc-emmylua/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ Test autodoc
55

66
src/annotations.rst
77
src/autoindex.rst
8+
src/doctype.rst
89
src/globals.rst
910
src/global_tables.rst
1011
src/incongruent_export.rst
1112
src/member_ordering.rst
1213
src/module_title.rst
14+
src/module_function.rst
1315
src/nested_modules.rst
1416
src/nesting_recursive.rst
1517
src/nesting.rst
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--- Documentation.
2+
return function() end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Module function
2+
===============
3+
4+
.. container:: regression
5+
6+
.. lua:autoobject:: module_function

test/test_regression.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def test_autodoc_regression(app, src, file_regression):
9494
"src/globals.html",
9595
"src/incongruent_export.html",
9696
"src/member_ordering.html",
97+
"src/module_function.html",
9798
"src/module_title.html",
9899
"src/nested_modules.html",
99100
"src/nesting_recursive.html",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div class="regression docutils container">
2+
<p id="lua-module_function">
3+
Documentation.
4+
</p>
5+
<p>
6+
<strong>
7+
Require:
8+
</strong>
9+
<code class="docutils literal notranslate">
10+
<span class="pre">
11+
require_2("module_function"):
12+
</span>
13+
<span class="xref lua lua-obj n">
14+
<span class="pre">
15+
fun()
16+
</span>
17+
</span>
18+
</code>
19+
</p>
20+
</div>

0 commit comments

Comments
 (0)