Skip to content

Commit bbeba97

Browse files
committed
Improves tests. Fixes imports (#35)
* Improves tests. Fixes imports * Make 1.8 the minimum julia requirement (can't wait for new LTS) * CI: Julia 1.8
1 parent 55c22cb commit bbeba97

File tree

10 files changed

+30
-13
lines changed

10 files changed

+30
-13
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
fail-fast: false
5151
matrix:
5252
version:
53-
- "1.7"
53+
- "1.8"
5454
- "1"
5555
- "pre"
5656
os:

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
/docs/build/
66
/docs/Manifest.toml
77

8-
/perf/Manifest.toml
8+
/perf/Manifest.toml
9+
10+
.gitignore
11+
12+
.DS_Store

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
1111
Dictionaries = "0.4"
1212
TestItemRunner = "0.2, 1"
1313
TestItems = "0.1, 1"
14-
julia = "1.7"
14+
julia = "1.8"
1515

1616
[extras]
1717
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
18+
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
19+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
1820
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1921
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
2022

2123
[targets]
22-
test = ["Aqua", "Test", "TestItemRunner"]
24+
test = ["Aqua", "ExplicitImports", "JET", "Test", "TestItemRunner"]

src/ConstraintCommons.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module ConstraintCommons
22

33
#!SECTION -- Imports
4-
using Dictionaries
5-
using TestItems
4+
import Dictionaries: AbstractDictionary, Dictionary, set!
5+
import TestItems: @testitem
66

77
#!SECTION -- Exports
88

src/nothing.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ consisempty(::Nothing) = true
1515
consisempty(items) = @inline isempty(items)
1616

1717
@testitem "Set: nothing" tags=[:set, :nothing] begin
18-
@test !(ConstraintCommons.consin(42, nothing))
19-
@test ConstraintCommons.consisempty(nothing)
18+
import ConstraintCommons: consin, consisempty
19+
@test !(consin(42, nothing))
20+
@test consisempty(nothing)
2021
end

src/symbols.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ function symcon(s1::Symbol, s2::Symbol, connector::AbstractString = "_")
88
end
99

1010
@testitem "Symbols" tags=[:symbols] begin
11-
@test ConstraintCommons.symcon(:a, :b) === :a_b
11+
import ConstraintCommons: symcon
12+
@test symcon(:a, :b) === :a_b
1213
end

test/Aqua.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
@testset "Aqua.jl" begin
2-
import Aqua
3-
import ConstraintCommons
4-
import Dictionaries
5-
62
# TODO: Fix the broken tests and remove the `broken = true` flag
73
Aqua.test_all(
84
ConstraintCommons;

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(ConstraintCommons) === 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(ConstraintCommons; target_defined_modules = true)
3+
end

test/runtests.jl

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

49
@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)