forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docview.jl
29 lines (24 loc) · 1.04 KB
/
docview.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This file is a part of Julia. License is MIT: https://julialang.org/license
using Test
import REPL
import Markdown
@testset "symbol completion" begin
@test startswith(let buf = IOBuffer()
Core.eval(Main, REPL.helpmode(buf, "α"))
String(take!(buf))
end, "\"α\" can be typed by \\alpha<tab>\n")
@test startswith(let buf = IOBuffer()
Core.eval(Main, REPL.helpmode(buf, "🐨"))
String(take!(buf))
end, "\"🐨\" can be typed by \\:koala:<tab>\n")
@test startswith(let buf = IOBuffer()
Core.eval(Main, REPL.helpmode(buf, "ᵞ₁₂₃¹²³α"))
String(take!(buf))
end, "\"ᵞ₁₂₃¹²³α\" can be typed by \\^gamma<tab>\\_123<tab>\\^123<tab>\\alpha<tab>\n")
end
@testset "Non-Markdown" begin
# https://github.com/JuliaLang/julia/issues/37765
@test isa(REPL.insert_hlines(IOBuffer(), Markdown.Text("foo")), Markdown.Text)
# https://github.com/JuliaLang/julia/issues/37757
@test REPL.insert_hlines(IOBuffer(), nothing) === nothing
end