From 5b7ce39f3b8766215de7acbdb61fc17d75ae9716 Mon Sep 17 00:00:00 2001 From: Tortar <68152031+Tortar@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:17:55 +0100 Subject: [PATCH] Add Aqua tests (#41) --- Project.toml | 8 +------- README.md | 1 + test/Project.toml | 6 ++++++ test/package_sanity_tests.jl | 7 +++++++ test/runtests.jl | 1 + 5 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 test/Project.toml create mode 100644 test/package_sanity_tests.jl diff --git a/Project.toml b/Project.toml index 906d108..59cf4ac 100644 --- a/Project.toml +++ b/Project.toml @@ -9,14 +9,8 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" SumTypes = "8e1ec7a9-0e02-4297-b0fe-6433085c89f2" [compat] -julia = "1" +julia = "1.6" ExprTools = "0.1" MacroTools = "0.5" PrecompileTools = "1" SumTypes = "0.5" - -[extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] diff --git a/README.md b/README.md index eb4c937..025cbed 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![CI](https://github.com/JuliaDynamics/MixedStructTypes.jl/workflows/CI/badge.svg)](https://github.com/JuliaDynamics/MixedStructTypes.jl/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/JuliaDynamics/MixedStructTypes.jl/graph/badge.svg?token=rz9b1WTqCa)](https://codecov.io/gh/JuliaDynamics/MixedStructTypes.jl) +[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) This package allows to combine multiple heterogeneous types in a single one. This helps to write type-stable code by avoiding Union-splitting, which have big performance drawbacks when many types are unionized. diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..345980a --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,6 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +Aqua = "0.8" diff --git a/test/package_sanity_tests.jl b/test/package_sanity_tests.jl new file mode 100644 index 0000000..c64c6db --- /dev/null +++ b/test/package_sanity_tests.jl @@ -0,0 +1,7 @@ + +using Aqua + +@testset "Code quality" begin + Aqua.test_all(MixedStructTypes, ambiguities = false, unbound_args = true) + @test Test.detect_ambiguities(MixedStructTypes) == Tuple{Method, Method}[] +end diff --git a/test/runtests.jl b/test/runtests.jl index 5311bda..fe5d7de 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,7 @@ using Test using MixedStructTypes @testset "MixedStructTypes.jl Tests" begin + include("package_sanity_tests.jl") include("sum_structs_macro_tests.jl") include("compact_structs_macro_tests.jl") end