Skip to content

Commit a83d83f

Browse files
authored
Merge pull request #58 from JuliaConstraints/fixes
Fixes for tests
2 parents 46e4a1c + 6042ba7 commit a83d83f

File tree

7 files changed

+26
-20
lines changed

7 files changed

+26
-20
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ version = "0.3.12"
55

66
[deps]
77
ConstraintCommons = "e37357d9-0691-492f-a822-e5ea6a920954"
8-
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
98
Intervals = "d8418881-c3e1-53bb-8760-2df7ec849ed5"
109
PatternFolds = "c18a7f1d-76ad-4ce4-950d-5419b888513b"
1110
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1211
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
1312

1413
[compat]
1514
ConstraintCommons = "0.2"
16-
Dictionaries = "0.4"
1715
Intervals = "1"
1816
PatternFolds = "0.2"
1917
StatsBase = "0.34"
@@ -23,8 +21,10 @@ julia = "1.8"
2321

2422
[extras]
2523
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
24+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
25+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
2626
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2727
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
2828

2929
[targets]
30-
test = ["Aqua", "Test", "TestItemRunner"]
30+
test = ["Aqua", "ExplicitImports", "JET", "Test", "TestItemRunner"]

src/ConstraintDomains.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module ConstraintDomains
22

33
# SECTION - Imports
4-
using ConstraintCommons
5-
using Dictionaries
6-
using PatternFolds
7-
using StatsBase
8-
using TestItems
4+
import ConstraintCommons: ConstraintCommons, δ_extrema
5+
# import Dictionaries
6+
import PatternFolds: PatternFolds, Interval, Closed
7+
import StatsBase: sample
8+
import TestItems: @testitem
99

1010
# Exports
1111
export AbstractDomain
1212
export ContinuousDomain
1313
export DiscreteDomain
14-
# export DiscreteSet # not defined
1514
export ExploreSettings
1615
export RangeDomain
16+
export SetDomain
1717

1818
export add!
1919
export delete!

src/general.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Extends `Base.convert` for domains.
1313
"""
1414
function Base.convert(::Type{Intervals}, d::RangeDomain{T}) where {T<:Real}
1515
a, b = extrema(get_domain(d))
16-
return domain(Float64(a) .. Float64(b))
16+
return domain(Interval{T,Closed,Closed}(a, b))
1717
end
1818

1919
function Base.convert(::Type{RangeDomain}, d::Intervals{T}) where {T<:Real}
@@ -23,6 +23,6 @@ function Base.convert(::Type{RangeDomain}, d::Intervals{T}) where {T<:Real}
2323
return domain(a:b)
2424
end
2525

26-
function Base.convert(::Type{RangeDomain}, d::SetDomain{T}) where {T<:Integer}
26+
function Base.convert(::Type{RangeDomain}, d::SetDomain)
2727
return domain(collect(get_domain(d)))
2828
end

test/Aqua.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
@testset "Aqua.jl" begin
2-
import Aqua
3-
import ConstraintDomains
4-
import Dictionaries
5-
62
# TODO: Fix the broken tests and remove the `broken = true` flag
73
Aqua.test_all(
84
ConstraintDomains;
@@ -20,9 +16,6 @@
2016
end
2117

2218
@testset "Dependencies compatibility (no extras)" begin
23-
Aqua.test_deps_compat(
24-
ConstraintDomains;
25-
check_extras = false, # ignore = [:Random]
26-
)
19+
Aqua.test_deps_compat(ConstraintDomains; check_extras = false)
2720
end
2821
end

test/ExplicitImports.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@testset "Look for Explicit Imports" begin
2+
@test check_no_implicit_imports(ConstraintDomains) === nothing
3+
end

test/JET.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@testset "Code linting (JET.jl)" begin
2+
JET.test_package(ConstraintDomains; target_defined_modules = true)
3+
end

test/runtests.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
using ConstraintDomains
2+
3+
using Aqua
4+
using ExplicitImports
5+
using JET
16
using Test
27
using TestItemRunner
38

4-
@testset "Package tests: ConstraintDomains" begin
9+
@testset "Package tests: ConstraintCommons" begin
510
include("Aqua.jl")
11+
include("ExplicitImports.jl")
12+
include("JET.jl")
613
include("TestItemRunner.jl")
714
end

0 commit comments

Comments
 (0)