Skip to content

Commit

Permalink
fixed nesting in runtests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
colinleach committed Sep 2, 2024
1 parent 90f7ccc commit e3e65e0
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 69 deletions.
3 changes: 3 additions & 0 deletions exercises/practice/kindergarten-garden/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"authors": [
"colinleach"
],
"contributors": [
"depial"
],
"files": {
"solution": [
"kindergarten-garden.jl"
Expand Down
140 changes: 71 additions & 69 deletions exercises/practice/kindergarten-garden/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,89 @@ using Test

include("kindergarten-garden.jl")

@testset verbose = true "partial garden" begin
@testset "garden with single student" begin
@test plants("RC\nGG", "Alice") == ["radishes", "clover", "grass", "grass"]
@testset verbose = true "tests" begin
@testset "partial garden" begin
@testset "garden with single student" begin
@test plants("RC\nGG", "Alice") == ["radishes", "clover", "grass", "grass"]
end

@testset "different garden with single student" begin
@test plants("VC\nRC", "Alice") == ["violets", "clover", "radishes", "clover"]
end

@testset "garden with two students" begin
@test plants("VVCG\nVVRC", "Bob") == ["clover", "grass", "radishes", "clover"]
end

@testset "second student's garden" begin
@test plants("VVCCGG\nVVCCGG", "Bob") == ["clover", "clover", "clover", "clover"]
end

@testset "third student's garden" begin
@test plants("VVCCGG\nVVCCGG", "Charlie") == ["grass", "grass", "grass", "grass"]
end
end

@testset "different garden with single student" begin
@test plants("VC\nRC", "Alice") == ["violets", "clover", "radishes", "clover"]
end

@testset "garden with two students" begin
@test plants("VVCG\nVVRC", "Bob") == ["clover", "grass", "radishes", "clover"]
end

@testset "second student's garden" begin
@test plants("VVCCGG\nVVCCGG", "Bob") == ["clover", "clover", "clover", "clover"]
end

@testset "third student's garden" begin
@test plants("VVCCGG\nVVCCGG", "Charlie") == ["grass", "grass", "grass", "grass"]
end
end

@testset verbose = true "full garden" begin
@testset "for Alice, first student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Alice") == ["violets", "radishes", "violets", "radishes"]
end
@testset "full garden" begin
@testset "for Alice, first student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Alice") == ["violets", "radishes", "violets", "radishes"]
end

@testset "for Bob, second student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Bob") == ["clover", "grass", "clover", "clover"]
end
@testset "for Bob, second student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Bob") == ["clover", "grass", "clover", "clover"]
end

@testset "for Charlie" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Charlie") == ["violets", "violets", "clover", "grass"]
end
@testset "for Charlie" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Charlie") == ["violets", "violets", "clover", "grass"]
end

@testset "for David" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "David") == ["radishes", "violets", "clover", "radishes"]
end
@testset "for David" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "David") == ["radishes", "violets", "clover", "radishes"]
end

@testset "for Eve" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Eve") == ["clover", "grass", "radishes", "grass"]
end
@testset "for Eve" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Eve") == ["clover", "grass", "radishes", "grass"]
end

@testset "for Fred" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Fred") == ["grass", "clover", "violets", "clover"]
end
@testset "for Fred" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Fred") == ["grass", "clover", "violets", "clover"]
end

@testset "for Ginny" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Ginny") == ["clover", "grass", "grass", "clover"]
end
@testset "for Ginny" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Ginny") == ["clover", "grass", "grass", "clover"]
end

@testset "for Harriet" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Harriet") == ["violets", "radishes", "radishes", "violets"]
end
@testset "for Harriet" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Harriet") == ["violets", "radishes", "radishes", "violets"]
end

@testset "for Ileana" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Ileana") == ["grass", "clover", "violets", "clover"]
end
@testset "for Ileana" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Ileana") == ["grass", "clover", "violets", "clover"]
end

@testset "for Joseph" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Joseph") == ["violets", "clover", "violets", "grass"]
end
@testset "for Joseph" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Joseph") == ["violets", "clover", "violets", "grass"]
end

@testset "for Kincaid, second to last student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Kincaid") == ["grass", "clover", "clover", "grass"]
end
@testset "for Kincaid, second to last student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Kincaid") == ["grass", "clover", "clover", "grass"]
end

@testset "for Larry, last student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Larry") == ["grass", "violets", "clover", "violets"]
end
@testset "for Larry, last student's garden" begin
diagram = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
@test plants(diagram, "Larry") == ["grass", "violets", "clover", "violets"]
end

end
end

0 comments on commit e3e65e0

Please sign in to comment.