Skip to content

Commit

Permalink
Fixup: Switch to ErrorException
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed Oct 19, 2023
1 parent 0cf79a4 commit 35edb68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/transcode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ function transcode!(
codec::Codec,
input::Buffer,
)
@assert !Base.mightalias(input.data, output.data) "input and outbut buffers must be independent"
Base.mightalias(input.data, output.data) && error(
"input and outbut buffers must be independent"
)
unsafe_transcode!(output, codec, input)
end

Expand Down
2 changes: 1 addition & 1 deletion test/codecnoop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
data = UInt8[]
@test TranscodingStreams.unsafe_transcode!(Noop(), data, data) == data
data = [0x01, 0x02]
@test_throws AssertionError transcode(Noop(), data, data)
@test_throws ErrorException transcode(Noop(), data, data)
data = b""
@test transcode(Noop(), data) == data
@test transcode(Noop(), data) !== data
Expand Down

2 comments on commit 35edb68

@jakobnissen
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/93690

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.1 -m "<description of version>" 35edb68440c9803640949850a1f82c27dd9cd61e
git push origin v0.10.1

Please sign in to comment.