Added example for how to use estap:test_dir().
authorStanislaw Klekot <dozzie@jarowit.net>
Tue, 16 Jun 2015 01:24:16 +0000 (03:24 +0200)
committerStanislaw Klekot <dozzie@jarowit.net>
Tue, 16 Jun 2015 01:24:16 +0000 (03:24 +0200)
examples/05_test_dir_listing.t [new file with mode: 0644]

diff --git a/examples/05_test_dir_listing.t b/examples/05_test_dir_listing.t
new file mode 100644 (file)
index 0000000..53bd6aa
--- /dev/null
@@ -0,0 +1,27 @@
+#!bin/estap
+
+-module(qwerty).
+
+-plan(3).
+
+-some_attribute(attr_value).
+-another_attribute("string value").
+
+-test("list of module attributes").
+attrs() ->
+  Attrs = [{N, estap:explain(V)} || {N,V} <- module_info(attributes)],
+  estap:info("module attrs", Attrs),
+  ok.
+
+-test("process dictionary").
+proc_dict() ->
+  Dict = [{N, estap:explain(V)} || {N,V} <- get()],
+  estap:info("process dictionary", Dict),
+  ok.
+
+-test("listing test files").
+ls() ->
+  estap:info("all test files", filelib:wildcard("*.t", estap:test_dir())),
+  ok.
+
+%% vim:ft=erlang