@@ -382,6 +382,24 @@ defmodule ExDoc.Language.ErlangTest do
382
382
) =~ ~s| documentation references callback "c:erlang_bar:bad/0" but it is undefined|
383
383
end
384
384
385
+ test "bad local type in module" , c do
386
+ assert warn (
387
+ fn ->
388
+ assert autolink_doc ( "\n `t:bad/0`" , c ) == ~s| <code class="inline">t:bad/0</code>|
389
+ end ,
390
+ line: 2
391
+ ) =~ ~s| documentation references type "t:bad/0" but it is undefined or private|
392
+ end
393
+
394
+ test "bad local callback in module" , c do
395
+ assert warn (
396
+ fn ->
397
+ assert autolink_doc ( "\n `c:bad/0`" , c ) == ~s| <code class="inline">c:bad/0</code>|
398
+ end ,
399
+ line: 2
400
+ ) =~ ~s| documentation references callback "c:bad/0" but it is undefined|
401
+ end
402
+
385
403
test "bad function in module ref" , c do
386
404
assert warn (
387
405
fn ->
@@ -448,6 +466,18 @@ defmodule ExDoc.Language.ErlangTest do
448
466
~s| <code class="inline">...a/0</code>|
449
467
end
450
468
469
+ @ tag warnings: :send
470
+ test "bad type" , c do
471
+ assert warn (
472
+ fn ->
473
+ assert autolink_extra ( "`t:bad:bad/0`" , c ) ==
474
+ ~s| <code class="inline">t:bad:bad/0</code>|
475
+ end ,
476
+ file: "extra.md" ,
477
+ line: 1
478
+ ) =~ ~s| documentation references type "t:bad:bad/0" but it is undefined or private|
479
+ end
480
+
451
481
@ tag warnings: :send
452
482
test "bad type ref" , c do
453
483
assert warn (
@@ -460,6 +490,18 @@ defmodule ExDoc.Language.ErlangTest do
460
490
) =~ ~s| documentation references type "t:bad:bad/0" but it is undefined or private|
461
491
end
462
492
493
+ @ tag warnings: :send
494
+ test "bad callback" , c do
495
+ assert warn (
496
+ fn ->
497
+ assert autolink_extra ( "`c:bad:bad/0`" , c ) ==
498
+ ~s| <code class="inline">c:bad:bad/0</code>|
499
+ end ,
500
+ file: "extra.md" ,
501
+ line: 1
502
+ ) =~ ~s| documentation references callback "c:bad:bad/0" but it is undefined|
503
+ end
504
+
463
505
test "bad module" , c do
464
506
assert autolink_extra ( "`does_not_exist`" , c ) ==
465
507
~s| <code class="inline">does_not_exist</code>|
0 commit comments