From 6d3d679441c4f9aa2724f1b09cfaecc23d0fb709 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Wed, 28 Dec 2022 00:09:04 +0000 Subject: [PATCH] Fix for buggy `Base.isless` impl (#100) --- Project.toml | 2 +- src/LogDensityProblems.jl | 2 +- test/runtests.jl | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 7890308..99c6664 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LogDensityProblems" uuid = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c" authors = ["Tamas K. Papp "] -version = "2.0.0" +version = "2.0.1" [deps] ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197" diff --git a/src/LogDensityProblems.jl b/src/LogDensityProblems.jl index 6fc253c..1d90208 100644 --- a/src/LogDensityProblems.jl +++ b/src/LogDensityProblems.jl @@ -38,7 +38,7 @@ end LogDensityOrder(K::Integer) = LogDensityOrder{K}() -Base.isless(::LogDensityOrder{A}, ::LogDensityOrder{B}) where {A, B} = A ≤ B +Base.isless(::LogDensityOrder{A}, ::LogDensityOrder{B}) where {A, B} = A < B """ $(SIGNATURES) diff --git a/test/runtests.jl b/test/runtests.jl index 2b2b30e..a9bd425 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -76,6 +76,7 @@ Base.show(io::IO, ::TestLogDensity) = print(io, "TestLogDensity") @test LogDensityOrder(1) == LogDensityOrder(1) @test_throws ArgumentError LogDensityOrder(-1) @test LogDensityOrder(2) ≥ LogDensityOrder(1) + @test !(LogDensityOrder(1) > LogDensityOrder(1)) end ####