23
23
include (abspath (makejl))
24
24
@test readmake () == 1
25
25
26
- def = (nothing , String[], String[], " docs" , " build" )
26
+ def = (nothing , String[], String[], String[], " docs" , " build" )
27
27
28
28
# callback function
29
29
dw = LS. SimpleWatcher ()
60
60
# error if there's no docs/ folder
61
61
cray = Crayon (foreground= :cyan , bold= true )
62
62
println (cray, " \n ⚠ Deliberately causing an error to be displayed and handled...\n " )
63
- @test_throws ErrorException LS. scan_docs! (dw, " docs" , " " , " " )
63
+ @test_throws ErrorException LS. scan_docs! (dw, " docs" , " " , " " , String[] )
64
64
65
65
empty! (dw. watchedfiles)
66
66
70
70
write (joinpath (" docs" , " src" , " index2.md" ), " Random file" )
71
71
write (joinpath (" docs" , " make.jl" ), " 1+1" )
72
72
73
+ mkdir (" extrasrc" )
74
+ write (joinpath (" extrasrc" , " extra.md" ), " Extra source file" )
75
+
73
76
mkdir (joinpath (" docs" , " lit" ))
74
77
write (joinpath (" docs" , " lit" , " index.jl" ), " 1+1" )
75
78
76
- LS. scan_docs! (dw, " docs" , " docs/make.jl" , joinpath (" docs" , " lit" ))
79
+ LS. scan_docs! (dw, " docs" , " docs/make.jl" , joinpath (" docs" , " lit" ), [ abspath ( " extrasrc " )] )
77
80
78
- @test length (dw. watchedfiles) == 3 # index.jl, index2.md, make.jl
81
+ @test length (dw. watchedfiles) == 4 # index.jl, index2.md, make.jl, extra.md
79
82
@test endswith (dw. watchedfiles[1 ]. path, " make.jl" )
80
83
@test endswith (dw. watchedfiles[2 ]. path, " index2.md" )
81
- @test endswith (dw. watchedfiles[3 ]. path, " index.jl" )
84
+ @test endswith (dw. watchedfiles[3 ]. path, " extra.md" )
85
+ @test endswith (dw. watchedfiles[4 ]. path, " index.jl" )
82
86
83
87
cd (bk)
84
88
end
107
111
# callback function
108
112
dw = LS. SimpleWatcher ()
109
113
110
- LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], " site" , " build" )
114
+ LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], String[], " site" , " build" )
111
115
112
116
@test length (dw. watchedfiles) == 3
113
117
@test dw. watchedfiles[1 ]. path == joinpath (" site" , " make.jl" )
@@ -118,14 +122,14 @@ end
118
122
119
123
# let's now remove `index2.md`
120
124
rm (joinpath (" site" , " src" , " index2.md" ))
121
- LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], " site" , " build" )
125
+ LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], String[], " site" , " build" )
122
126
123
127
# the file has been removed
124
128
@test length (dw. watchedfiles) == 2
125
129
@test readmake () == 3
126
130
127
131
# let's check there's an appropriate trigger for index
128
- LS. servedocs_callback! (dw, joinpath (" site" , " src" , " index.md" ), makejl, " " , String[], String[], " site" , " build" )
132
+ LS. servedocs_callback! (dw, joinpath (" site" , " src" , " index.md" ), makejl, " " , String[], String[], String[], " site" , " build" )
129
133
@test length (dw. watchedfiles) == 2
130
134
@test readmake () == 4
131
135
140
144
# error if there's no docs/ folder
141
145
cray = Crayon (foreground= :cyan , bold= true )
142
146
println (cray, " \n ⚠ Deliberately causing an error to be displayed and handled...\n " )
143
- @test_throws ErrorException LS. scan_docs! (dw, " site" , " site" , " " )
147
+ @test_throws ErrorException LS. scan_docs! (dw, " site" , " site" , " " , String[] )
144
148
145
149
empty! (dw. watchedfiles)
146
150
153
157
mkdir (joinpath (" site" , " lit" ))
154
158
write (joinpath (" site" , " lit" , " index.jl" ), " 1+1" )
155
159
156
- LS. scan_docs! (dw, " site" , " site/make.jl" , joinpath (" site" , " lit" ))
160
+ LS. scan_docs! (dw, " site" , " site/make.jl" , joinpath (" site" , " lit" ), String[] )
157
161
158
162
@test length (dw. watchedfiles) == 3 # index.jl, index2.md, make.jl
159
163
@test endswith (dw. watchedfiles[1 ]. path, " make.jl" )
0 commit comments