23
23
include (abspath (makejl))
24
24
@test readmake () == 1
25
25
26
- def = (nothing , String[], String[], String[], " docs" , " build" )
26
+ def = (nothing , String[], 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" , " " , " " , String[])
63
+ @test_throws ErrorException LS. scan_docs! (dw, " docs" , " " , " " , String[], 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" )
73
+ mkdir (" extradir" )
74
+ write (joinpath (" extradir" , " extra.md" ), " Extra source file" )
75
+
76
+ mkdir (" extradir2" )
77
+ write (joinpath (" extradir2" , " extra2.md" ), " Extra source file 2" )
75
78
76
79
mkdir (joinpath (" docs" , " lit" ))
77
80
write (joinpath (" docs" , " lit" , " index.jl" ), " 1+1" )
78
81
79
- LS. scan_docs! (dw, " docs" , " docs/make.jl" , joinpath (" docs" , " lit" ), [abspath (" extrasrc " )])
82
+ LS. scan_docs! (dw, " docs" , " docs/make.jl" , joinpath (" docs" , " lit" ), [abspath (" extradir " )], [ abspath ( " extradir2 " , " extra2.md " )])
80
83
81
- @test length (dw. watchedfiles) == 4 # index.jl, index2.md, make.jl, extra.md
84
+ @test length (dw. watchedfiles) == 5 # index.jl, index2.md, make.jl, extra.md, extra2 .md
82
85
@test endswith (dw. watchedfiles[1 ]. path, " make.jl" )
83
86
@test endswith (dw. watchedfiles[2 ]. path, " index2.md" )
84
87
@test endswith (dw. watchedfiles[3 ]. path, " extra.md" )
85
- @test endswith (dw. watchedfiles[4 ]. path, " index.jl" )
88
+ @test endswith (dw. watchedfiles[4 ]. path, " extra2.md" )
89
+ @test endswith (dw. watchedfiles[5 ]. path, " index.jl" )
86
90
87
91
cd (bk)
88
92
end
111
115
# callback function
112
116
dw = LS. SimpleWatcher ()
113
117
114
- LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], String[], " site" , " build" )
118
+ LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], String[], String[], " site" , " build" )
115
119
116
120
@test length (dw. watchedfiles) == 3
117
121
@test dw. watchedfiles[1 ]. path == joinpath (" site" , " make.jl" )
@@ -122,14 +126,14 @@ end
122
126
123
127
# let's now remove `index2.md`
124
128
rm (joinpath (" site" , " src" , " index2.md" ))
125
- LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], String[], " site" , " build" )
129
+ LS. servedocs_callback! (dw, makejl, makejl, " " , String[], String[], String[], String[], " site" , " build" )
126
130
127
131
# the file has been removed
128
132
@test length (dw. watchedfiles) == 2
129
133
@test readmake () == 3
130
134
131
135
# let's check there's an appropriate trigger for index
132
- LS. servedocs_callback! (dw, joinpath (" site" , " src" , " index.md" ), makejl, " " , String[], String[], String[], " site" , " build" )
136
+ LS. servedocs_callback! (dw, joinpath (" site" , " src" , " index.md" ), makejl, " " , String[], String[], String[], String[], " site" , " build" )
133
137
@test length (dw. watchedfiles) == 2
134
138
@test readmake () == 4
135
139
144
148
# error if there's no docs/ folder
145
149
cray = Crayon (foreground= :cyan , bold= true )
146
150
println (cray, " \n ⚠ Deliberately causing an error to be displayed and handled...\n " )
147
- @test_throws ErrorException LS. scan_docs! (dw, " site" , " site" , " " , String[])
151
+ @test_throws ErrorException LS. scan_docs! (dw, " site" , " site" , " " , String[], String[] )
148
152
149
153
empty! (dw. watchedfiles)
150
154
157
161
mkdir (joinpath (" site" , " lit" ))
158
162
write (joinpath (" site" , " lit" , " index.jl" ), " 1+1" )
159
163
160
- LS. scan_docs! (dw, " site" , " site/make.jl" , joinpath (" site" , " lit" ), String[])
164
+ LS. scan_docs! (dw, " site" , " site/make.jl" , joinpath (" site" , " lit" ), String[], String[] )
161
165
162
166
@test length (dw. watchedfiles) == 3 # index.jl, index2.md, make.jl
163
167
@test endswith (dw. watchedfiles[1 ]. path, " make.jl" )
0 commit comments