Skip to content

Commit 8e44a72

Browse files
authored
Fix broken test (#1)
Formerly it used a dumb algorithm to determine the end of a sentence.
1 parent 74c9df5 commit 8e44a72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ModuleDocstrings.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ function firstsentence(str::AbstractString)
5252
for line in split(str, '\n')
5353
startswith(line, " ") && continue # code line
5454
all(isspace, line) && continue
55-
idx = findfirst('.', line)
55+
idx = findfirst(r"\.(\s|$)", line)
5656
if idx === nothing
5757
print(io, line, ' ')
5858
continue
5959
end
60-
print(io, line[1:idx])
60+
print(io, line[1:first(idx)])
6161
return String(take!(io))
6262
end
6363
return String(take!(io))

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ using Test
3030
end)
3131
@test occursin("- `Main.anonymous.foo1`: `foo1` is pretty useful.", str)
3232
@test occursin("- `Main.anonymous.foo2`: `foo2` doesn't show the signature.", str)
33-
@test_broken occursin("- `Main.anonymous.foo3`: `foo3` contains a [`Main.anonymous.foo1`](@ref) that contains a period.", str)
33+
@test occursin("- `Main.anonymous.foo3`: `foo3` contains a [`Main.anonymous.foo1`](@ref) that contains a period.", str)
3434
end

0 commit comments

Comments
 (0)