Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Moelf committed Dec 11, 2021
1 parent e22bddf commit 77aaff0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ julia = "1.0"
TerminalRegressionTests = "98bfdc55-cc95-5876-a49a-74609291cbe0"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
VT100 = "7774df62-37c0-5c21-b34d-f6d7f98f54bc"
CodeTracking="da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"

[targets]
test = ["Test", "TerminalRegressionTests", "VT100"]
test = ["Test", "TerminalRegressionTests", "VT100", "CodeTracking"]
17 changes: 17 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,21 @@ withenv("FORCE_COLOR" => true) do
include("test_bracketmatch.jl")
include("test_highlighter.jl")
include("test_rainbowbrackets.jl")

end

using Test, OhMyREPL, CodeTracking
@testset "code_src macro" begin
original_stdout = stdout

(rd, wr) = redirect_stdout();

@code_src sum(1:3)
redirect_stdout(original_stdout)
close(wr)

s = read(rd, String)
redirect_stdout(original_stdout)
@test contains(s, "\e[")
@test contains(s, "AbstractRange")
end

0 comments on commit 77aaff0

Please sign in to comment.