@@ -354,6 +354,61 @@ defmodule ExDoc.Retriever.ErlangTest do
354
354
|> Erlang . autolink_spec ( current_module: :mod , current_kfa: { :type , :type , 0 } ) ==
355
355
"type() :: #a{a :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:pos_integer/0\" >pos_integer</a>(), b :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:non_neg_integer/0\" >non_neg_integer</a>(), c :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:atom/0\" >atom</a>(), d :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:term/0\" >term</a>(), e :: <a href=\" https://www.erlang.org/doc/apps/erts/erlang.html#t:term/0\" >term</a>()}."
356
356
end
357
+
358
+ @ tag :ci
359
+ test "modules with encrypted debug info" , c do
360
+ File . cp! ( "test/fixtures/.erlang.crypt" , ".erlang.crypt" )
361
+
362
+ erlc (
363
+ c ,
364
+ :debug_info_mod ,
365
+ ~S"""
366
+ -module(debug_info_mod).
367
+ -moduledoc("mod docs.").
368
+ -export([function1/0]).
369
+ -export_type([foo/0]).
370
+
371
+ -doc("foo/0 docs.").
372
+ -type foo() :: atom().
373
+
374
+ -doc("function1/0 docs.").
375
+ -spec function1() -> atom().
376
+ function1() -> ok.
377
+ """ ,
378
+ debug_info_key: ~c" SECRET"
379
+ )
380
+
381
+ { [ mod ] , [ ] } = Retriever . docs_from_modules ( [ :debug_info_mod ] , % ExDoc.Config { } )
382
+
383
+ assert % ExDoc.ModuleNode {
384
+ moduledoc_file: moduledoc_file ,
385
+ docs: [ function1 ] ,
386
+ id: "debug_info_mod" ,
387
+ module: :debug_info_mod ,
388
+ title: "debug_info_mod" ,
389
+ typespecs: [ foo ]
390
+ } = mod
391
+
392
+ assert DocAST . to_string ( mod . doc ) =~ "mod docs."
393
+ assert DocAST . to_string ( function1 . doc ) =~ "function1/0 docs."
394
+ assert DocAST . to_string ( foo . doc ) =~ "foo/0 docs."
395
+ assert moduledoc_file =~ "debug_info_mod.erl"
396
+
397
+ erlc (
398
+ c ,
399
+ :debug_info_mod2 ,
400
+ ~S"""
401
+ -module(debug_info_mod2).
402
+ -moduledoc("mod docs.").
403
+ """ ,
404
+ debug_info_key: { :des3_cbc , ~c" PASSWORD" }
405
+ )
406
+
407
+ assert { [ % ExDoc.ModuleNode { module: :debug_info_mod2 } ] , [ ] } =
408
+ Retriever . docs_from_modules ( [ :debug_info_mod2 ] , % ExDoc.Config { } )
409
+
410
+ File . rm! ( ".erlang.crypt" )
411
+ end
357
412
end
358
413
359
414
describe "docs_from_modules/2 edoc" do
0 commit comments