test graphemes

pull/3/head
matthieugomez 2015-11-07 10:35:23 -05:00
parent 1e39213a45
commit 16fafd4414
2 changed files with 5 additions and 2 deletions

View File

@ -68,7 +68,7 @@ function Base.chr2ind(s::GraphemeIterator, i::Integer)
end
end
Base.endof(g::GraphemeIterator) = endof(g.s)
Base.SubString(x::GraphemeIterator, i, j) = SubString(x.s, i, j)
Base.SubString(x::GraphemeIterator, i, j) = graphemes(SubString(x.s, i, j))
typealias GraphemeOrString Union{GraphemeIterator, AbstractString}

View File

@ -149,4 +149,7 @@ for x in solutions
for i in 1:length(solution)
@test_approx_eq_eps evaluate(t, strings[i]...) solution[i] 1e-4
end
end
end
@test evaluate(Hamming(), "b\u0300", "a") == 2
@test evaluate(Hamming(), graphemes("b\u0300"), graphemes("a")) == 1