Closed oxinabox closed 6 years ago
Error During Test at /home/travis/build/KristofferC/Crayons.jl/test/runtests.jl:135
Test threw exception MethodError(convert, (Union{String, Crayons.CrayonWrapper}, String), 0x0000000000006afc)
Expression: string((Crayon())("hello")) == "hello"
MethodError: Cannot `convert` an object of type Type{String} to an object of type Union{String, Crayons.CrayonWrapper}
Closest candidates are:
convert(::Type{T}, !Matched::T) where T at essentials.jl:123
Well that was dumb of me. Good thing I also wrote a test to prove how good at stopping mid-sentence I am.
Merging #22 into master will increase coverage by
0.04%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #22 +/- ##
==========================================
+ Coverage 94.64% 94.69% +0.04%
==========================================
Files 6 6
Lines 224 226 +2
==========================================
+ Hits 212 214 +2
Misses 12 12
Impacted Files | Coverage Δ | |
---|---|---|
src/crayon_wrapper.jl | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f17f76c...505e45a. Read the comment docs.
I thought far too hard about String
vs string
string(xs...)
Create a string from any values using the print function.
String(s::AbstractString)
Convert a string to a contiguous byte array representation encoded as UTF-8 bytes. This representation is often appropriate for passing strings to C.
Yeah, sorry, I deleted my comment straight away because I realized it should be string
:)
Ah that would be why github went weird on me Cool, thanks
String
I mean!
I wanted to use a Crayon on a Regex capture. But it failed as those are
SubString
s.This is one way to fix it, by converting the inputs The other would be to change the Struct to allow
Union{CrayonWrapper, AbstractStrings}
which has problems of its own.