Skip to content

Test: Fix indenting on verbose no-failure report #43251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/Test/src/Test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ end
function get_alignment(ts::DefaultTestSet, depth::Int)
# The minimum width at this depth is
ts_width = 2*depth + length(ts.description)
# If all passing, no need to look at children
!ts.anynonpass && return ts_width
# If not verbose and all passing, no need to look at children
!ts.verbose && !ts.anynonpass && return ts_width
# Return the maximum of this width and the minimum width
# for all children (if they exist)
isempty(ts.results) && return ts_width
Expand Down
24 changes: 12 additions & 12 deletions stdlib/Test/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1079,17 +1079,17 @@ end

@testset "verbose option" begin
expected = """
Test Summary: | Pass Total
Parent | 9 9
Child 1 | 3 3
Child 1.1 | 1 1
Child 1.2 | 1 1
Child 1.3 | 1 1
Child 2 | 3 3
Child 3 | 3 3
Child 3.1 | 1 1
Child 3.2 | 1 1
Child 3.3 | 1 1
Test Summary: | Pass Total
Parent | 9 9
Child 1 | 3 3
Child 1.1 (long name) | 1 1
Child 1.2 | 1 1
Child 1.3 | 1 1
Child 2 | 3 3
Child 3 | 3 3
Child 3.1 | 1 1
Child 3.2 | 1 1
Child 3.3 | 1 1
"""

mktemp() do f, _
Expand All @@ -1099,7 +1099,7 @@ end

@testset "Parent" verbose = true begin
@testset "Child 1" verbose = true begin
@testset "Child 1.1" begin
@testset "Child 1.1 (long name)" begin
@test 1 == 1
end

Expand Down