Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
I messed up somehow and committed a typo (I left out a colon).

This commit also ensures that ==(Action, Bool) gives the same result as
==(Bool, Action), because that just makes sense.

Sorry, Simon!
  • Loading branch information
cmcaine committed Mar 15, 2023
1 parent 6bdd564 commit 567ecb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/glfw3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ end
#
# This method tells Julia how to compare an Action and a Bool so that code
# calling GetKey as documented will work as expected.
Base.(==)(b::Bool, a::Action) = b == Integer(a)
Base.:(==)(b::Bool, a::Action) = b == Integer(a)
Base.:(==)(a::Action, b::Bool) = b == a

@enum Key::Cint begin
# Unknown key
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ println(GLFW.GetVersionString())

# https://github.com/JuliaGL/GLFW.jl/pull/225
@test GLFW.PRESS == true
@test true == GLFW.PRESS
@test GLFW.RELEASE == false
@test false == GLFW.RELEASE

if !haskey(ENV, "CI") # AppVeyor and Travis CI don't support OpenGL
include("windowclose.jl")
Expand Down

0 comments on commit 567ecb2

Please sign in to comment.