Skip to content

Commit

Permalink
test: add trait tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Oct 23, 2023
1 parent 9bea164 commit 859e130
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using SymbolicIndexingInterface
using Test

@testset begin
@testset "Interface test" begin
@time include("example_test.jl")
end
@testset "Trait test" begin
@time include("trait_test.jl")
end
14 changes: 14 additions & 0 deletions test/trait_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using SymbolicUtils
using Symbolics
using SymbolicIndexingInterface
using Test

@test all(issymbolic.([Int, Float64, String, Bool, UInt, Complex{Float64}]) .==
(NotSymbolic(),))
@test all(issymbolic.([Symbol, SymbolicUtils.BasicSymbolic, Symbolics.Num]) .==
(Symbolic(),))
@variables x
@test issymbolic(x) == Symbolic()
@variables y[1:3]
@test issymbolic(y) == NotSymbolic()
@test all(issymbolic.(collect(y)) .== (Symbolic(),))

0 comments on commit 859e130

Please sign in to comment.