@@ -2,5 +2,48 @@ using MultiDocumenter
2
2
using Test
3
3
4
4
@testset " MultiDocumenter.jl" begin
5
- # Write your tests here.
5
+ clonedir = mktempdir ()
6
+
7
+ docs = [
8
+ (" JuliaDebug/Infiltrator.jl.git" , " gh-pages" ) => MultiDocumenter. MultiDocRef (
9
+ upstream = joinpath (clonedir, " Infiltrator" ),
10
+ path = " inf" ,
11
+ name = " Infiltrator"
12
+ ),
13
+ ]
14
+
15
+ for ((remote, branch), docref) in docs
16
+ run (
` git clone --depth 1 [email protected] :$remote --branch $branch --single-branch $(docref. upstream) ` )
17
+ end
18
+
19
+ outpath = joinpath (@__DIR__ , " out" )
20
+
21
+ MultiDocumenter. make (
22
+ outpath,
23
+ collect (last .(docs));
24
+ search_engine = MultiDocumenter. SearchConfig (
25
+ index_versions = [" stable" ],
26
+ engine = MultiDocumenter. FlexSearch
27
+ )
28
+ )
29
+
30
+ @testset " flexsearch" begin
31
+ @test isdir (outpath, " inf" )
32
+ @test isdir (outpath, " inf" , " stable" )
33
+ @test isfile (outpath, " inf" , " stable" , " index.html" )
34
+
35
+ @test read (joinpath (outpath, " inf" , " index.html" ), String) == """
36
+ <!--This file is automatically generated by Documenter.jl-->
37
+ <meta http-equiv="refresh" content="0; url=./stable/"/>
38
+ """
39
+
40
+ @test isdir (outpath, " search-data" )
41
+ store_content = read (joinpath (outpath, " search-data" , " store.json" ), String)
42
+ @test ! isempty (store_content)
43
+ @test occursin (" Infiltrator.jl" , store_content)
44
+ @test occursin (" @infiltrate" , store_content)
45
+ end
46
+
47
+ rm (outpath, recursive= true , force= true )
48
+ rm (clonedir, recursive= true , force= true )
6
49
end
0 commit comments