@@ -29,9 +29,14 @@ const keydict = Dict(:up => "\e[A",
29
29
if isdefined (Base, :active_repl )
30
30
@test Cthulhu. default_terminal () isa REPL. Terminals. TTYTerminal
31
31
end
32
- colorize (use_color :: Bool , c:: Char ) = Cthulhu. stringify () do io
33
- use_color ? printstyled (io, c; color= :cyan ) : print (io, c)
32
+ colorize (active_option :: Bool , c:: Char ) = Cthulhu. stringify () do io
33
+ active_option ? printstyled (io, c; color= :green ) : printstyled (io, c; color = :red )
34
34
end
35
+
36
+ colorize (s:: AbstractString ; color:: Symbol = :cyan ) = Cthulhu. stringify () do io
37
+ printstyled (io, s; color)
38
+ end
39
+
35
40
# Write a file that we track with Revise. Creating it programmatically allows us to rewrite it with
36
41
# different content
37
42
fn = tempname ()
@@ -64,14 +69,14 @@ const keydict = Dict(:up => "\e[A",
64
69
@test occursin (' [' * colorize (true , ' o' ) * " ]ptimize" , lines)
65
70
@test occursin (' [' * colorize (true , ' T' ) * " ]yped" , lines)
66
71
67
- @test occursin (" \n Select a call to descend into" , lines) # beginning of the line
72
+ @test occursin (' \n ' * colorize ( " Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark. " ; color = :blue ) , lines) # beginning of the line
68
73
@test occursin (' •' , lines)
69
74
write (in, ' o' ) # switch to unoptimized
70
75
lines = cread (out)
71
76
@test occursin (" invoke simplef(::Float32,::Int32)::Float32" , lines)
72
77
@test occursin (r" \( z = a \* a\)\u 001B\[\d\d m::Float32\u 001B\[ 39m" , lines)
73
78
@test occursin (' [' * colorize (false , ' o' ) * " ]ptimize" , lines)
74
- @test occursin (" \n Select a call to descend into" , lines) # beginning of the line
79
+ @test occursin (' \n ' * colorize ( " Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark. " ; color = :blue ) , lines) # beginning of the line
75
80
@test occursin (" • %1 = *(::Float32,::Float32)::Float32" , lines)
76
81
# Call selection
77
82
write (in, keydict[:down ])
@@ -103,7 +108,7 @@ const keydict = Dict(:up => "\e[A",
103
108
@test occursin (r" z.*::Float32" , lines)
104
109
@test occursin (r" \n Body.*Float32" , lines)
105
110
@test occursin (' [' * colorize (true , ' w' ) * " ]arn" , lines)
106
- @test occursin (" \n Select a call to descend into" , lines) # beginning of the line
111
+ @test occursin (' \n ' * colorize ( " Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark. " ; color = :blue ) , lines) # beginning of the line
107
112
@test occursin (" • %1 = *(::Float32,::Float32)::Float32" , lines)
108
113
# Source view
109
114
write (in, ' S' )
@@ -146,7 +151,7 @@ const keydict = Dict(:up => "\e[A",
146
151
write (in, ' d' ); cread (out)
147
152
write (in, ' L' )
148
153
lines = cread (out)
149
- @test occursin (' [ ' * colorize ( false , ' d ' ) * " ]ebuginfo" , lines)
154
+ @test occursin (" [d ]ebuginfo" , lines)
150
155
@test ! occursin (" ┌ @ promotion.jl" , lines)
151
156
# Native-code view
152
157
write (in, ' N' )
0 commit comments