From 999f3dae4d1a89696fb18c72115745c28a05d6db Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 20 Dec 2023 12:33:11 +0530 Subject: [PATCH] TEMP: logging after every test --- test/symbolic_indexing_interface_test.jl | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/symbolic_indexing_interface_test.jl b/test/symbolic_indexing_interface_test.jl index 67c3b3b4..a1282214 100644 --- a/test/symbolic_indexing_interface_test.jl +++ b/test/symbolic_indexing_interface_test.jl @@ -11,41 +11,72 @@ dx = DiffEqArray([[f(x), f2(x)] for x in t], parameters = [:p, :q], independent_variables = [:t]) @test dx[:t] == t +@info "TEST 1" @test dx[:a] == [f(x) for x in t] +@info "TEST 2" @test dx[:a, 2] ≈ f(t[2]) +@info "TEST 3" @test dx[:b, 3] ≈ f2(t[3]) +@info "TEST 4" @test dx[:a, 2:4] ≈ [f(x) for x in t[2:4]] +@info "TEST 5" @test dx[:b, 4:6] ≈ [f2(x) for x in t[4:6]] +@info "TEST 6" @test dx[:b] ≈ [f2(x) for x in t] +@info "TEST 7" @test dx[[:a, :b]] ≈ [[f(x), f2(x)] for x in t] +@info "TEST 8" @test dx[(:a, :b)] == [(f(x), f2(x)) for x in t] +@info "TEST 9" @test dx[[:a, :b], 3] ≈ [f(t[3]), f2(t[3])] +@info "TEST 10" @test dx[[:a, :b], 4:5] ≈ vcat(f.(t[4:5])', f2.(t[4:5])') +@info "TEST 11" @test getp(dx, [:p, :q])(dx) == [1.0, 2.0] +@info "TEST 12" @test getp(dx, :p)(dx) == 1.0 +@info "TEST 13" @test getp(dx, :q)(dx) == 2.0 +@info "TEST 14" @test_deprecated dx[:p] +@info "TEST 15" @test_deprecated dx[[:p, :q]] +@info "TEST 16" @test dx[:t] == t +@info "TEST 17" @test symbolic_container(dx) isa SymbolCache +@info "TEST 18" @test parameter_values(dx) == [1.0, 2.0] +@info "TEST 19" @test is_variable.((dx,), [:a, :b, :p, :q, :t]) == [true, true, false, false, false] +@info "TEST 20" @test variable_index.((dx,), [:a, :b, :p, :q, :t]) == [1, 2, nothing, nothing, nothing] +@info "TEST 21" @test is_parameter.((dx,), [:a, :b, :p, :q, :t]) == [false, false, true, true, false] +@info "TEST 22" @test parameter_index.((dx,), [:a, :b, :p, :q, :t]) == [nothing, nothing, 1, 2, nothing] +@info "TEST 23" @test is_independent_variable.((dx,), [:a, :b, :p, :q, :t]) == [false, false, false, false, true] +@info "TEST 24" @test variable_symbols(dx) == [:a, :b] +@info "TEST 25" @test parameter_symbols(dx) == [:p, :q] +@info "TEST 26" @test independent_variable_symbols(dx) == [:t] +@info "TEST 27" @test is_time_dependent(dx) +@info "TEST 28" @test constant_structure(dx) +@info "TEST 29" dx = DiffEqArray([[f(x), f2(x)] for x in t], t; variables = [:a, :b]) @test_throws Exception dx[nothing] # make sure it isn't storing [nothing] as indepsym +@info "TEST 30" ABC = @SLVector (:a, :b, :c); A = ABC(1, 2, 3); B = RecursiveArrayTools.DiffEqArray([A, A], [0.0, 2.0]); @test getindex(B, :a) == [1, 1] +@info "TEST 31"