Skip to content
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

Use Verbose Unit Testing for Comprehensive Testing Summary #680

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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
100 changes: 51 additions & 49 deletions exercises/practice/pangram/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,60 @@ using Test

include("pangram.jl")

@testset "empty sentence" begin
@test !ispangram("")
end

@testset "perfect lower case" begin
@test ispangram("abcdefghijklmnopqrstuvwxyz")
end
@testset verbose = true "pangram" begin
@testset "empty sentence" begin
@test !ispangram("")
end

@testset "perfect lower case" begin
@test ispangram("abcdefghijklmnopqrstuvwxyz")
end

@testset "pangram with only lower case" begin
@test ispangram("the quick brown fox jumps over the lazy dog")
end

@testset "missing character 'x'" begin
@test !ispangram("a quick movement of the enemy will jeopardize five gunboats")
end

@testset "another missing character 'x'" begin
@test !ispangram("the quick brown fish jumps over the lazy dog")
end
@testset "pangram with only lower case" begin
@test ispangram("the quick brown fox jumps over the lazy dog")
end
@testset "missing character 'x'" begin
@test !ispangram("a quick movement of the enemy will jeopardize five gunboats")
end
@testset "another missing character 'x'" begin
@test !ispangram("the quick brown fish jumps over the lazy dog")
end

@testset "missing character 'h'" begin
@test !ispangram("five boxing wizards jump quickly at it")
end

@testset "pangram with underscores" begin
@test ispangram("the_quick_brown_fox_jumps_over_the_lazy_dog")
end

@testset "pangram with numbers" begin
@test ispangram("the 1 quick brown fox jumps over the 2 lazy dogs")
end

@testset "missing letters replaced by numbers" begin
@test !ispangram("7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")
end

@testset "pangram with mixed case and punctuation" begin
@test ispangram("\"Five quacking Zephyrs jolt my wax bed.\"")
end

@testset "upper and lower case versions of the same character should not be counted separately" begin
@test !ispangram("the quick brown fox jumped over the lazy FOX")
end
@testset "missing character 'h'" begin
@test !ispangram("five boxing wizards jump quickly at it")
end
@testset "pangram with underscores" begin
@test ispangram("the_quick_brown_fox_jumps_over_the_lazy_dog")
end
@testset "pangram with numbers" begin
@test ispangram("the 1 quick brown fox jumps over the 2 lazy dogs")
end
@testset "missing letters replaced by numbers" begin
@test !ispangram("7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog")
end
@testset "pangram with mixed case and punctuation" begin
@test ispangram("\"Five quacking Zephyrs jolt my wax bed.\"")
end
@testset "upper and lower case versions of the same character should not be counted separately" begin
@test !ispangram("the quick brown fox jumped over the lazy FOX")
end

@testset "a-m and A-M are 26 different letters but not a pangram" begin
@test !ispangram("abcdefghijklm ABCDEFGHIJKLM")
end
@testset "a-m and A-M are 26 different letters but not a pangram" begin
@test !ispangram("abcdefghijklm ABCDEFGHIJKLM")
end

@testset "pangram with more than 26 letters (if case sensitive)" begin
@test ispangram("the 1 quick brown fox jumps Over the 2 lazy dogs")
end
@testset "pangram with more than 26 letters (if case sensitive)" begin
@test ispangram("the 1 quick brown fox jumps Over the 2 lazy dogs")
end

@testset "An Arabic pangram is not an English pangram" begin
@test !ispangram("The scholar and poet Al Farāhīdi wrote this Arabic pangram: صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ")
@testset "An Arabic pangram is not an English pangram" begin
@test !ispangram("The scholar and poet Al Farāhīdi wrote this Arabic pangram: صِف خَلقَ خَودِ كَمِثلِ الشَمسِ إِذ بَزَغَت — يَحظى الضَجيعُ بِها نَجلاءَ مِعطارِ")
end
end