aboutsummaryrefslogtreecommitdiff
path: root/challenge-279/barroff/julia/ch-2.jl
blob: 2e0d370b7771699a1546e0ec5346fa48ff728224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env julia

using Test: @test, @testset

function split_string(str::AbstractString)::Bool
    vowels = Set(['a', 'e', 'i', 'o', 'u'])
    count(x -> x in vowels, collect(str)) % 2 == 0
end

@testset "split string" begin
    @test split_string("perl") == false
    @test split_string("book") == true
    @test split_string("good morning") == true
end