From cfb042304c7f6d35876d31e2224640398bdce42f Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Sun, 11 Mar 2018 15:51:40 -0700 Subject: [PATCH] Test module docstrings --- tests/native_tests/language.hy | 5 +++++ tests/resources/module_docstring_example.hy | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 tests/resources/module_docstring_example.hy diff --git a/tests/native_tests/language.hy b/tests/native_tests/language.hy index 393dfdf..098a685 100644 --- a/tests/native_tests/language.hy +++ b/tests/native_tests/language.hy @@ -1785,6 +1785,11 @@ macros() (assert (none? (. f4 __doc__))) (assert (= (f4 [1 2]) "not a docstring"))) +(defn test-module-docstring [] + (import [tests.resources.module-docstring-example :as m]) + (assert (= m.__doc__ "This is the module docstring.")) + (assert (= m.foo 5))) + (defn test-relative-import [] "Make sure relative imports work properly" (import [..resources [tlib]]) diff --git a/tests/resources/module_docstring_example.hy b/tests/resources/module_docstring_example.hy new file mode 100644 index 0000000..3e74462 --- /dev/null +++ b/tests/resources/module_docstring_example.hy @@ -0,0 +1,3 @@ +"This is the module docstring." + +(setv foo 5)