@@ -41,26 +41,34 @@ defmodule ExDoc.AutolinkTest do
4141
4242 test "project-local module" do
4343 ExDoc.Refs . insert ( [
44- { { :module , Foo } , :public }
44+ { { :module , AutolinkTest. Foo} , :public }
4545 ] )
4646
47- assert autolink ( "Foo" ) == ~m" [`Foo`](Foo.html)"
47+ assert autolink ( "AutolinkTest. Foo" ) == ~m" [`AutolinkTest. Foo`](AutolinkTest. Foo.html)"
4848 assert autolink ( "String" , app: :elixir ) == ~m" [`String`](String.html)"
49- assert autolink ( "Foo" , current_module: Foo ) == ~m" [`Foo`](#content)"
49+
50+ assert autolink ( "AutolinkTest.Foo" , current_module: AutolinkTest.Foo ) ==
51+ ~m" [`AutolinkTest.Foo`](#content)"
5052 end
5153
5254 test "remote function" do
5355 ExDoc.Refs . insert ( [
54- { { :module , Foo } , :public } ,
55- { { :function , Foo , :foo , 1 } , :public } ,
56- { { :function , Foo , :. , 2 } , :public } ,
57- { { :function , Foo , :.. , 2 } , :public }
56+ { { :module , AutolinkTest. Foo} , :public } ,
57+ { { :function , AutolinkTest. Foo, :foo , 1 } , :public } ,
58+ { { :function , AutolinkTest. Foo, :. , 2 } , :public } ,
59+ { { :function , AutolinkTest. Foo, :.. , 2 } , :public }
5860 ] )
5961
60- assert autolink ( "Foo.foo/1" ) == ~m" [`Foo.foo/1`](Foo.html#foo/1)"
61- assert autolink ( "Foo../2" ) == ~m" [`Foo../2`](Foo.html#./2)"
62- assert autolink ( "Foo.../2" ) == ~m" [`Foo.../2`](Foo.html#../2)"
63- assert_unchanged ( "Bad.bar/1" )
62+ assert autolink ( "AutolinkTest.Foo.foo/1" ) ==
63+ ~m" [`AutolinkTest.Foo.foo/1`](AutolinkTest.Foo.html#foo/1)"
64+
65+ assert autolink ( "AutolinkTest.Foo../2" ) ==
66+ ~m" [`AutolinkTest.Foo../2`](AutolinkTest.Foo.html#./2)"
67+
68+ assert autolink ( "AutolinkTest.Foo.../2" ) ==
69+ ~m" [`AutolinkTest.Foo.../2`](AutolinkTest.Foo.html#../2)"
70+
71+ assert_unchanged ( "AutolinkTest.Bad.bar/1" )
6472 end
6573
6674 test "elixir stdlib function" do
@@ -80,16 +88,16 @@ defmodule ExDoc.AutolinkTest do
8088
8189 test "local function" do
8290 ExDoc.Refs . insert ( [
83- { { :module , Foo } , :public } ,
84- { { :function , Foo , :foo , 1 } , :public } ,
85- { { :function , Foo , :. , 2 } , :public } ,
86- { { :function , Foo , :.. , 2 } , :public }
91+ { { :module , AutolinkTest. Foo} , :public } ,
92+ { { :function , AutolinkTest. Foo, :foo , 1 } , :public } ,
93+ { { :function , AutolinkTest. Foo, :. , 2 } , :public } ,
94+ { { :function , AutolinkTest. Foo, :.. , 2 } , :public }
8795 ] )
8896
89- assert autolink ( "foo/1" , current_module: Foo ) == ~m" [`foo/1`](#foo/1)"
90- assert autolink ( "./2" , current_module: Foo ) == ~m" [`./2`](#./2)"
91- assert autolink ( "../2" , current_module: Foo ) == ~m" [`../2`](#../2)"
92- assert_unchanged ( "bar/1" , current_module: Foo )
97+ assert autolink ( "foo/1" , current_module: AutolinkTest. Foo) == ~m" [`foo/1`](#foo/1)"
98+ assert autolink ( "./2" , current_module: AutolinkTest. Foo) == ~m" [`./2`](#./2)"
99+ assert autolink ( "../2" , current_module: AutolinkTest. Foo) == ~m" [`../2`](#../2)"
100+ assert_unchanged ( "bar/1" , current_module: AutolinkTest. Foo)
93101 end
94102
95103 test "sibling function" do
@@ -281,12 +289,12 @@ defmodule ExDoc.AutolinkTest do
281289
282290 test "remotes" do
283291 ExDoc.Refs . insert ( [
284- { { :module , Foo } , :public } ,
285- { { :type , Foo , :t , 0 } , :public }
292+ { { :module , AutolinkTest. Foo} , :public } ,
293+ { { :type , AutolinkTest. Foo, :t , 0 } , :public }
286294 ] )
287295
288- assert typespec ( quote ( do: t ( ) :: Foo . t ( ) ) ) ==
289- ~s[ t() :: <a href="Foo.html#t:t/0">Foo.t</a>()]
296+ assert typespec ( quote ( do: t ( ) :: AutolinkTest. Foo. t ( ) ) ) ==
297+ ~s[ t() :: <a href="AutolinkTest. Foo.html#t:t/0">AutolinkTest. Foo.t</a>()]
290298 end
291299
292300 test "autolinks same type and function name" do
@@ -343,23 +351,26 @@ defmodule ExDoc.AutolinkTest do
343351
344352 test "warnings" do
345353 ExDoc.Refs . insert ( [
346- { { :module , Foo } , :public } ,
347- { { :function , Foo , :bar , 1 } , :hidden } ,
348- { { :type , Foo , :bad , 0 } , :hidden }
354+ { { :module , AutolinkTest. Foo} , :public } ,
355+ { { :function , AutolinkTest. Foo, :bar , 1 } , :hidden } ,
356+ { { :type , AutolinkTest. Foo, :bad , 0 } , :hidden }
349357 ] )
350358
351- captured = warn ( "Foo.bar/1" , file: "lib/foo.ex" , line: 1 , id: nil )
352- assert captured =~ "documentation references \" Foo.bar/1\" but it is hidden\n "
359+ captured = warn ( "AutolinkTest. Foo.bar/1" , file: "lib/foo.ex" , line: 1 , id: nil )
360+ assert captured =~ "documentation references \" AutolinkTest. Foo.bar/1\" but it is hidden\n "
353361 assert captured =~ ~r{ lib/foo.ex:1\n $}
354362
355- assert warn ( "t:Foo.bad/0" , file: "lib/foo.ex" , id: "Foo.foo/0" ) =~
356- "documentation references \" t:Foo.bad/0\" but it is hidden or private\n "
363+ assert warn ( "t:AutolinkTest. Foo.bad/0" , file: "lib/foo.ex" , id: "AutolinkTest. Foo.foo/0" ) =~
364+ "documentation references \" t:AutolinkTest. Foo.bad/0\" but it is hidden or private\n "
357365
358- assert warn ( "t:Elixir.Foo.bad/0" , file: "lib/foo.ex" , id: "Foo.foo/0" ) =~
359- "documentation references \" t:Elixir.Foo.bad/0\" but it is hidden or private\n "
366+ assert warn ( "t:Elixir.AutolinkTest.Foo.bad/0" ,
367+ file: "lib/foo.ex" ,
368+ id: "AutolinkTest.Foo.foo/0"
369+ ) =~
370+ "documentation references \" t:Elixir.AutolinkTest.Foo.bad/0\" but it is hidden or private\n "
360371
361- assert warn ( "t:Foo.bad/0" , file: "lib/foo.ex" , id: "Foo.foo/0" ) =~
362- "documentation references \" t:Foo.bad/0\" but it is hidden or private\n "
372+ assert warn ( "t:AutolinkTest. Foo.bad/0" , file: "lib/foo.ex" , id: "AutolinkTest. Foo.foo/0" ) =~
373+ "documentation references \" t:AutolinkTest. Foo.bad/0\" but it is hidden or private\n "
363374
364375 warn ( "String.upcase/9" , [ ] )
365376
@@ -368,8 +379,8 @@ defmodule ExDoc.AutolinkTest do
368379 warn ( "t:Calendar.date/9" , [ ] )
369380
370381 warn ( fn ->
371- assert typespec ( quote ( do: t ( ) :: Foo . bad ( ) ) ) ==
372- ~s[ t() :: Foo.bad()]
382+ assert typespec ( quote ( do: t ( ) :: AutolinkTest. Foo. bad ( ) ) ) ==
383+ ~s[ t() :: AutolinkTest. Foo.bad()]
373384 end )
374385
375386 warn ( fn ->
0 commit comments