-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
A few fixes for 0.6 #290
A few fixes for 0.6 #290
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -849,7 +849,7 @@ mktempdir() do dir | |
verbose && println("$name write(::IOBuffer, ...)") | ||
@compat to = IOBuffer(UInt8[convert(UInt8, _) for _ in text], false, true) | ||
write(to, io()) | ||
@test takebuf_string(to) == text | ||
@test String(take!(to)) == text | ||
|
||
cleanup() | ||
end | ||
|
@@ -1106,7 +1106,7 @@ end | |
|
||
for (Fun, func) in [(:AndFun, :&), | ||
(:OrFun, :|), | ||
(:XorFun, :$), | ||
(:XorFun, :⊻), | ||
(:AddFun, :+), | ||
(:DotAddFun, :.+), | ||
(:SubFun, :-), | ||
|
@@ -1250,7 +1250,7 @@ end | |
|
||
let io = IOBuffer(), s = "hello" | ||
unsafe_write(io, pointer(s), length(s)) | ||
@test takebuf_string(io) == s | ||
@test String(take!(io)) == s | ||
end | ||
|
||
@static if VERSION ≥ v"0.4" | ||
|
@@ -1512,3 +1512,15 @@ end | |
|
||
@test xor(1,5) == 4 | ||
@test 1 ⊻ 5 == 4 | ||
|
||
# julia#19246 | ||
@test numerator(1//2) === 1 | ||
@test denominator(1//2) === 2 | ||
|
||
# julia#19088 | ||
let io = IOBuffer() | ||
write(io, "aaa") | ||
@test take!(io) == UInt8['a', 'a', 'a'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. It's actually tested twice above already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but it doesn't hurt to do that explicitly here too. |
||
write(io, "bbb") | ||
@test String(take!(io)) == "bbb" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
Compat.UTF8String(take!(io))
thanks to theCompat.String
mess?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I believe
takebuf_string
on 0.4 is actually type unstable. It can return eitherASCIIString
orUTF8String
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we need to define a ByteString(::Array{UInt8}) method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything that's broken? This won't work before the specific 0.4 commit but Compat.jl already require 0.4.0 now. Travis tests also seems to be passing on 0.4?