Skip to content

Commit 61a607a

Browse files
Reorganize Unitful-related tests to Extensions group
Move all tests that use Unitful functionality from the main test groups to the Extensions test group, where they belong now that Unitful support is provided by an extension: Moved tests: - units.jl (core Unitful extension tests) - variable_parsing.jl (uses Unitful units in variable declarations) - model_parsing.jl (uses Unitful units in model parsing) - constants.jl (uses Unitful units with constants) Updated constants.jl to remove UnitfulUnitCheck references: - Remove UMT = ModelingToolkit.UnitfulUnitCheck - Change UMT.get_unit(β) to ModelingToolkit.get_unit(β) These tests now run in the Extensions group where Unitful is available, ensuring the extension is properly loaded for testing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent dd8a2db commit 61a607a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

test/constants.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using ModelingToolkit, OrdinaryDiffEq, Unitful
22
using Test
33
MT = ModelingToolkit
4-
UMT = ModelingToolkit.UnitfulUnitCheck
54

65
@constants a = 1
76
@test isconstant(a)
@@ -25,7 +24,7 @@ simp = mtkcompile(sys)
2524

2625
#Constant with units
2726
@constants β=1 [unit = u"m/s"]
28-
UMT.get_unit(β)
27+
ModelingToolkit.get_unit(β)
2928
@test MT.isconstant(β)
3029
@test !MT.istunable(β)
3130
@independent_variables t [unit = u"s"]

test/runtests.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,18 @@ end
2929
@safetestset "AbstractSystem Test" include("abstractsystem.jl")
3030
@safetestset "Variable Scope Tests" include("variable_scope.jl")
3131
@safetestset "Symbolic Parameters Test" include("symbolic_parameters.jl")
32-
@safetestset "Parsing Test" include("variable_parsing.jl")
3332
@safetestset "Simplify Test" include("simplify.jl")
3433
@safetestset "Direct Usage Test" include("direct.jl")
3534
@safetestset "System Linearity Test" include("linearity.jl")
3635
@safetestset "Input Output Test" include("input_output_handling.jl")
3736
@safetestset "Clock Test" include("clock.jl")
3837
@safetestset "ODESystem Test" include("odesystem.jl")
3938
@safetestset "Dynamic Quantities Test" include("dq_units.jl")
40-
@safetestset "Unitful Quantities Test" include("units.jl")
4139
@safetestset "Mass Matrix Test" include("mass_matrix.jl")
4240
@safetestset "Reduction Test" include("reduction.jl")
4341
@safetestset "Split Parameters Test" include("split_parameters.jl")
4442
@safetestset "StaticArrays Test" include("static_arrays.jl")
4543
@safetestset "Components Test" include("components.jl")
46-
@safetestset "Model Parsing Test" include("model_parsing.jl")
4744
@safetestset "Error Handling" include("error_handling.jl")
4845
@safetestset "StructuralTransformations" include("structural_transformation/runtests.jl")
4946
@safetestset "Basic transformations" include("basic_transformations.jl")
@@ -58,7 +55,6 @@ end
5855
@safetestset "DAE Jacobians Test" include("dae_jacobian.jl")
5956
@safetestset "Jacobian Sparsity" include("jacobiansparsity.jl")
6057
@safetestset "Modelingtoolkitize Test" include("modelingtoolkitize.jl")
61-
@safetestset "Constants Test" include("constants.jl")
6258
@safetestset "Parameter Dependency Test" include("parameter_dependencies.jl")
6359
@safetestset "Equation Type Accessors Test" include("equation_type_accessors.jl")
6460
@safetestset "System Accessor Functions Test" include("accessor_functions.jl")
@@ -141,5 +137,9 @@ end
141137
@safetestset "BifurcationKit Extension Test" include("extensions/bifurcationkit.jl")
142138
@safetestset "InfiniteOpt Extension Test" include("extensions/test_infiniteopt.jl")
143139
@safetestset "Auto Differentiation Test" include("extensions/ad.jl")
140+
@safetestset "Unitful Extension Test" include("units.jl")
141+
@safetestset "Variable Parsing with Units Test" include("variable_parsing.jl")
142+
@safetestset "Model Parsing with Units Test" include("model_parsing.jl")
143+
@safetestset "Constants with Units Test" include("constants.jl")
144144
end
145145
end

0 commit comments

Comments
 (0)