@@ -84,7 +84,7 @@ defmodule ExDoc.Language.ErlangTest do
84
84
85
85
test "OTP function" , c do
86
86
assert autolink_edoc ( "{@link array:new/0}" , c ) ==
87
- ~s| <a href="https://www.erlang.org/doc/man/array.html#new- 0"><code>array:new/0</code></a>|
87
+ ~s| <a href="https://www.erlang.org/doc/man/array.html#new/ 0"><code>array:new/0</code></a>|
88
88
end
89
89
90
90
test "OTP function when generating OTP docs" , c do
@@ -99,12 +99,12 @@ defmodule ExDoc.Language.ErlangTest do
99
99
100
100
test "ERTS function" , c do
101
101
assert autolink_edoc ( "{@link zlib:gunzip/1}" , c ) ==
102
- ~s| <a href="https://www.erlang.org/doc/man/zlib.html#gunzip- 1"><code>zlib:gunzip/1</code></a>|
102
+ ~s| <a href="https://www.erlang.org/doc/man/zlib.html#gunzip/ 1"><code>zlib:gunzip/1</code></a>|
103
103
end
104
104
105
105
test "app function" , c do
106
106
assert autolink_edoc ( "{@link //stdlib/array:new/0}" , c ) ==
107
- ~s| <a href="https://www.erlang.org/doc/man/array.html#new- 0"><code>array:new/0</code></a>|
107
+ ~s| <a href="https://www.erlang.org/doc/man/array.html#new/ 0"><code>array:new/0</code></a>|
108
108
end
109
109
110
110
test "external function" , c do
@@ -124,12 +124,12 @@ defmodule ExDoc.Language.ErlangTest do
124
124
125
125
test "OTP type" , c do
126
126
assert autolink_edoc ( "{@link array:array()}" , c ) ==
127
- ~s| <a href="https://www.erlang.org/doc/man/array.html#type- array"><code>array:array()</code></a>|
127
+ ~s| <a href="https://www.erlang.org/doc/man/array.html#t: array/0 "><code>array:array()</code></a>|
128
128
end
129
129
130
130
test "app type" , c do
131
131
assert autolink_edoc ( "{@link //stdlib/array:array()}" , c ) ==
132
- ~s| <a href="https://www.erlang.org/doc/man/array.html#type- array"><code>array:array()</code></a>|
132
+ ~s| <a href="https://www.erlang.org/doc/man/array.html#t: array/0 "><code>array:array()</code></a>|
133
133
end
134
134
135
135
@ myList ( if :erlang . system_info ( :otp_release ) >= ~c" 27" do
@@ -310,7 +310,7 @@ defmodule ExDoc.Language.ErlangTest do
310
310
311
311
test "function in module autoimport using slash" , c do
312
312
assert autolink_doc ( "`node/0`" , c ) ==
313
- ~s| <a href="https://www.erlang.org/doc/man/erlang.html#node- 0"><code class="inline">node/0</code></a>|
313
+ ~s| <a href="https://www.erlang.org/doc/man/erlang.html#node/ 0"><code class="inline">node/0</code></a>|
314
314
end
315
315
316
316
test "type in module autoimport" , c do
@@ -320,7 +320,7 @@ defmodule ExDoc.Language.ErlangTest do
320
320
321
321
test "type in module autoimport using slash" , c do
322
322
assert autolink_doc ( "`t:integer/0`" , c ) ==
323
- ~s| <a href="https://www.erlang.org/doc/man/erlang.html#type- integer"><code class="inline">integer/0</code></a>|
323
+ ~s| <a href="https://www.erlang.org/doc/man/erlang.html#t: integer/0 "><code class="inline">integer/0</code></a>|
324
324
end
325
325
326
326
test "bad function in module code" , c do
@@ -335,7 +335,7 @@ defmodule ExDoc.Language.ErlangTest do
335
335
336
336
test "linking to auto-imported nil works" , c do
337
337
assert autolink_doc ( "[`[]`](`t:nil/0`)" , c ) ==
338
- ~s| <a href="https://www.erlang.org/doc/man/erlang.html#type- nil"><code class="inline">[]</code></a>|
338
+ ~s| <a href="https://www.erlang.org/doc/man/erlang.html#t: nil/0 "><code class="inline">[]</code></a>|
339
339
end
340
340
341
341
test "linking to local nil works" , c do
@@ -543,7 +543,7 @@ defmodule ExDoc.Language.ErlangTest do
543
543
544
544
test "OTP function" , c do
545
545
assert autolink_extra ( "`lists:reverse/1`" , c ) ==
546
- ~s| <a href="https://www.erlang.org/doc/man/lists.html#reverse- 1"><code class="inline">lists:reverse/1</code></a>|
546
+ ~s| <a href="https://www.erlang.org/doc/man/lists.html#reverse/ 1"><code class="inline">lists:reverse/1</code></a>|
547
547
end
548
548
549
549
test "type" , c do
@@ -553,7 +553,7 @@ defmodule ExDoc.Language.ErlangTest do
553
553
554
554
test "OTP type" , c do
555
555
assert autolink_extra ( "`t:array:array/0`" , c ) ==
556
- ~s| <a href="https://www.erlang.org/doc/man/array.html#type- array"><code class="inline">array:array/0</code></a>|
556
+ ~s| <a href="https://www.erlang.org/doc/man/array.html#t: array/0 "><code class="inline">array:array/0</code></a>|
557
557
end
558
558
559
559
test "module" , c do
@@ -684,9 +684,9 @@ defmodule ExDoc.Language.ErlangTest do
684
684
685
685
test "spec when fun is called record" , c do
686
686
assert autolink_spec ( "-spec record(module()) -> [[{module(), atom()}]]." , c ) ==
687
- ~s| record(<a href="https://www.erlang.org/doc/man/erlang.html#type- module">module</a>())| <>
688
- ~s| -> [[{<a href="https://www.erlang.org/doc/man/erlang.html#type- module">module</a>(),| <>
689
- ~s| <a href="https://www.erlang.org/doc/man/erlang.html#type- atom">atom</a>()}]].|
687
+ ~s| record(<a href="https://www.erlang.org/doc/man/erlang.html#t: module/0 ">module</a>())| <>
688
+ ~s| -> [[{<a href="https://www.erlang.org/doc/man/erlang.html#t: module/0 ">module</a>(),| <>
689
+ ~s| <a href="https://www.erlang.org/doc/man/erlang.html#t: atom/0 ">atom</a>()}]].|
690
690
end
691
691
692
692
test "callback" , c do
@@ -724,7 +724,7 @@ defmodule ExDoc.Language.ErlangTest do
724
724
~S" -spec foo() -> #{atom() := sets:set(integer()), float() => t()}." ,
725
725
c
726
726
) ==
727
- ~S| foo() -> #{<a href="https://www.erlang.org/doc/man/erlang.html#type- atom">atom</a>() := <a href="https://www.erlang.org/doc/man/sets.html#type- set">sets:set</a>(<a href="https://www.erlang.org/doc/man/erlang.html#type- integer">integer</a>()), <a href="https://www.erlang.org/doc/man/erlang.html#type- float">float</a>() => <a href="#t:t/0">t</a>()}.|
727
+ ~S| foo() -> #{<a href="https://www.erlang.org/doc/man/erlang.html#t: atom/0 ">atom</a>() := <a href="https://www.erlang.org/doc/man/sets.html#t: set/1 ">sets:set</a>(<a href="https://www.erlang.org/doc/man/erlang.html#t: integer/0 ">integer</a>()), <a href="https://www.erlang.org/doc/man/erlang.html#t: float/0 ">float</a>() => <a href="#t:t/0">t</a>()}.|
728
728
end
729
729
730
730
test "vars" , c do
@@ -744,12 +744,12 @@ defmodule ExDoc.Language.ErlangTest do
744
744
745
745
test "record - one field" , c do
746
746
assert autolink_spec ( ~s" -spec foo() -> #x{x :: atom()} | t()." , c ) ==
747
- ~s[ foo() -> #x{x :: <a href="https://www.erlang.org/doc/man/erlang.html#type- atom">atom</a>()} | <a href="#t:t/0">t</a>().]
747
+ ~s[ foo() -> #x{x :: <a href="https://www.erlang.org/doc/man/erlang.html#t: atom/0 ">atom</a>()} | <a href="#t:t/0">t</a>().]
748
748
end
749
749
750
750
test "record - two fields" , c do
751
751
assert autolink_spec ( ~s" -spec foo() -> #x{x :: atom(), y :: sets:set(integer())} | t()." , c ) ==
752
- ~s[ foo() -> #x{x :: <a href="https://www.erlang.org/doc/man/erlang.html#type- atom">atom</a>(), y :: <a href="https://www.erlang.org/doc/man/sets.html#type- set">sets:set</a>(<a href="https://www.erlang.org/doc/man/erlang.html#type- integer">integer</a>())} | <a href="#t:t/0">t</a>().]
752
+ ~s[ foo() -> #x{x :: <a href="https://www.erlang.org/doc/man/erlang.html#t: atom/0 ">atom</a>(), y :: <a href="https://www.erlang.org/doc/man/sets.html#t: set/1 ">sets:set</a>(<a href="https://www.erlang.org/doc/man/erlang.html#t: integer/0 ">integer</a>())} | <a href="#t:t/0">t</a>().]
753
753
end
754
754
755
755
test "record - two fields, known types" , c do
@@ -789,12 +789,12 @@ defmodule ExDoc.Language.ErlangTest do
789
789
790
790
test "OTP type" , c do
791
791
assert autolink_spec ( ~S" -spec foo() -> sets:set()." , c ) ==
792
- ~s| foo() -> <a href="https://www.erlang.org/doc/man/sets.html#type- set">sets:set</a>().|
792
+ ~s| foo() -> <a href="https://www.erlang.org/doc/man/sets.html#t: set/0 ">sets:set</a>().|
793
793
end
794
794
795
795
test "OTP private type" , c do
796
796
assert autolink_spec ( ~S" -spec foo() -> array:array_indx()." , c ) ==
797
- ~s| foo() -> <a href="https://www.erlang.org/doc/man/array.html#type- array_indx">array:array_indx</a>().|
797
+ ~s| foo() -> <a href="https://www.erlang.org/doc/man/array.html#t: array_indx/0 ">array:array_indx</a>().|
798
798
end
799
799
800
800
test "skip typespec name" , c do
@@ -820,7 +820,7 @@ defmodule ExDoc.Language.ErlangTest do
820
820
test "bad remote type" , c do
821
821
assert warn ( fn ->
822
822
assert autolink_spec ( ~S" -spec foo() -> bad:bad(atom())." , c , warnings: :send ) ==
823
- ~s| foo() -> bad:bad(<a href="https://www.erlang.org/doc/man/erlang.html#type- atom">atom</a>()).|
823
+ ~s| foo() -> bad:bad(<a href="https://www.erlang.org/doc/man/erlang.html#t: atom/0 ">atom</a>()).|
824
824
end ) =~ ~s| references type "bad:bad/1" but it is undefined or private|
825
825
end
826
826
end
0 commit comments