File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ @testitem " Validation(Tubular): rule order unit test" setup = [defaults] begin
2+ # Use fully-qualified names; do not add extra `using` here.
3+ V = LineCableModels. Validation
4+ T = LineCableModels. DataModel. Tubular
5+ M = LineCableModels. Materials. Material
6+
7+ r = V. _rules (T)
8+
9+ expected = (
10+ V. Normalized (:radius_in ), V. Normalized (:radius_ext ),
11+ V. Finite (:radius_in ), V. Nonneg (:radius_in ),
12+ V. Finite (:radius_ext ), V. Nonneg (:radius_ext ),
13+ V. Less (:radius_in , :radius_ext ),
14+ V. Finite (:temperature ),
15+ V. IsA {M} (:material_props ),
16+ )
17+
18+ if r != expected
19+ @error " [Validation] Rule set for Tubular is wrong. Someone ‘helpfully’ changed the bundle order or duplicated rules.\n " *
20+ " Expected exact structural equality with the generated bundle. Fix your traits/extra_rules and stop being clever."
21+ @show expected
22+ @show r
23+ end
24+
25+ @test r == expected
26+ end
You can’t perform that action at this time.
0 commit comments