Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8"
Documenter = "1"
HTTP = "1"
JET = "0.9, 0.10, 0.11"
JSON = "1"
Test = "1"
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using CTBase
using Test
using Aqua
using JET
#using JuliaFormatter
# using JET
# using JuliaFormatter
using Documenter
using HTTP
using JSON
Expand Down
6 changes: 3 additions & 3 deletions test/test_code_quality.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function test_code_quality()
Aqua.test_ambiguities(CTBase)
end

@testset "JET" begin
JET.test_package(CTBase; target_defined_modules=true)
end
# @testset "JET" begin
# JET.test_package(CTBase; target_defined_modules=true)
# end

# @testset "JuliaFormatter" begin
# @test JuliaFormatter.format(CTBase; verbose=true, overwrite=false)
Expand Down
38 changes: 20 additions & 18 deletions test/test_description.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ function test_description()
@test descriptions[2] == (:b,)
end

# Type stability test for adding descriptions using the is_inferred macro
@testset "Add Descriptions Type Stability" begin
@test_opt CTBase.add((), (:a,))
@test_inferred CTBase.add((), (:a,))
end
# # Type stability test for adding descriptions using the is_inferred macro
# # Needs JET
# @testset "Add Descriptions Type Stability" begin
# @test_opt CTBase.add((), (:a,))
# @test_inferred CTBase.add((), (:a,))
# end

# Test building algorithm descriptions and completing partial descriptions
@testset "Complete Descriptions with Algorithms" begin
Expand All @@ -39,19 +40,20 @@ function test_description()
(:descent, :gradient, :fixedstep)
end

# Type stability test for the complete function using the is_inferred macro
@testset "Complete Descriptions Type Stability" begin
algorithms = ()
algorithms = CTBase.add(algorithms, (:descent, :bfgs, :bisection))
algorithms = CTBase.add(algorithms, (:descent, :bfgs, :backtracking))
algorithms = CTBase.add(algorithms, (:descent, :bfgs, :fixedstep))
algorithms = CTBase.add(algorithms, (:descent, :gradient, :bisection))
algorithms = CTBase.add(algorithms, (:descent, :gradient, :backtracking))
algorithms = CTBase.add(algorithms, (:descent, :gradient, :fixedstep))
# # Type stability test for the complete function using the is_inferred macro
# # Needs JET
# @testset "Complete Descriptions Type Stability" begin
# algorithms = ()
# algorithms = CTBase.add(algorithms, (:descent, :bfgs, :bisection))
# algorithms = CTBase.add(algorithms, (:descent, :bfgs, :backtracking))
# algorithms = CTBase.add(algorithms, (:descent, :bfgs, :fixedstep))
# algorithms = CTBase.add(algorithms, (:descent, :gradient, :bisection))
# algorithms = CTBase.add(algorithms, (:descent, :gradient, :backtracking))
# algorithms = CTBase.add(algorithms, (:descent, :gradient, :fixedstep))

@test_opt CTBase.complete((:descent,); descriptions=algorithms)
@test_inferred CTBase.complete((:descent,); descriptions=algorithms)
end
# @test_opt CTBase.complete((:descent,); descriptions=algorithms)
# @test_inferred CTBase.complete((:descent,); descriptions=algorithms)
# end

# Test ambiguous or invalid description completions throw errors
@testset "Ambiguous and Incorrect Description Errors" begin
Expand Down Expand Up @@ -88,7 +90,7 @@ function test_description()

# instead of @inferred, check if the type is a subtype of Tuple{Vararg{Symbol}}
@test typeof(result) <: Tuple{Vararg{Symbol}}
@test_opt CTBase.remove(x, y)
# @test_opt CTBase.remove(x, y)
end

# Test completion with descriptions of different sizes and inclusion priority
Expand Down
Loading