Files
JuliaFEM.jl/test_minimal.jl
T
Jukka Aho a8d4f7e504 fix: Move Base imports before includes to fix method extension
CRITICAL FIX: Base function imports must come BEFORE any includes that define methods.

Problem:
- Had 'import Base: getindex, setindex!, ...' AFTER including files
- This caused "import conflicts with existing identifier" warnings
- Our getindex/setindex! methods were NOT extending Base, they were standalone
- Result: Dict{Int, Vector} getindex failed completely

Solution:
- Moved all Base imports to module top, right after 'module JuliaFEM'
- Now all our methods properly extend Base functions
- Removed duplicate imports later in file

Result:
-  5 TESTS PASSING! (back to baseline)
-  Core API works: Element creation, Problem creation, field updates
-  test_mortar_3d_polygon_clip.jl passes all 5 tests
- ⚠️  43 tests still error (but core functionality proven)

This was the root cause of test regression
2025-11-08 10:38:00 +02:00

42 lines
1.0 KiB
Julia

#!/usr/bin/env julia
# Minimal test to debug what's broken
using JuliaFEM
println("✓ JuliaFEM loaded")
# Test 1: Can we create an element?
try
element = Element(Seg2, (1, 2))
println("✓ Element created: ", typeof(element))
println(" length: ", length(element))
catch e
println("✗ Element creation failed: ", e)
end
# Test 2: Can we create a Problem?
try
problem = Problem(Dirichlet, "test", 1, "temperature")
println("✓ Problem created: ", typeof(problem))
catch e
println("✗ Problem creation failed: ", e)
end
# Test 3: Can we update element fields?
try
element = Element(Seg2, (1, 2))
X = Dict(1 => [0.0, 0.0], 2 => [6.0, 0.0])
update!(element, "geometry", X)
println("✓ Element update successful")
catch e
println("✗ Element update failed: ", e)
println(" Stacktrace:")
for (exc, bt) in Base.catch_stack()
showerror(stdout, exc, bt)
println()
end
end
println("\n=== Summary ===")
println("If all checks pass, the core API works!")