Skip to content

Commit de52114

Browse files
authored
Merge pull request #283 from jverzani/issue_202
2 parents 43a2bdf + 8e6ebc3 commit de52114

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/subs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ subs(ex::T, d::AbstractDict) where {T<:SymbolicType} = subs(ex, CMapBasicBasic(d
3333
subs(ex::T, y::Tuple{S, Any}) where {T <: SymbolicType, S<:SymbolicType} = subs(ex, y[1], y[2])
3434
subs(ex::T, y::Tuple{S, Any}, args...) where {T <: SymbolicType, S<:SymbolicType} = subs(subs(ex, y), args...)
3535
subs(ex::T, d::Pair...) where {T <: SymbolicType} = subs(ex, [(p.first, p.second) for p in d]...)
36-
36+
subs(ex::SymbolicType) = ex
3737

3838
## Allow an expression to be called, as with ex(2). When there is more than one symbol, one can rely on order of `free_symbols` or
3939
## be explicit by passing in pairs : `ex(x=>1, y=>2)` or a dict `ex(Dict(x=>1, y=>2))`.

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ for val in samples
155155
@test subs(ex, x => val) == val^2 + y^2
156156
@test subs(ex, SymEngine.CMapBasicBasic(Dict(x=>val))) == val^2 + y^2
157157
@test subs(ex, Dict(x=>val)) == val^2 + y^2
158+
@test subs(ex) == ex
158159
end
159160
# This probably results in a number of redundant tests (operator order).
160161
for val1 in samples, val2 in samples

0 commit comments

Comments
 (0)