Skip to content

Commit

Permalink
Merge 4e69e26 into 9c10b75
Browse files Browse the repository at this point in the history
  • Loading branch information
anandijain committed Nov 10, 2021
2 parents 9c10b75 + 4e69e26 commit 4111c32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MathML"
uuid = "abcecc63-2b08-419c-80c4-c63dca6fa478"
authors = ["anand <anandj@uchicago.edu> and contributors"]
version = "0.1.9"
version = "0.1.10"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -18,7 +18,7 @@ DocStringExtensions = "0.8"
EzXML = "1.1"
IfElse = "0.1"
SpecialFunctions = "1.3"
Symbolics = "3"
Symbolics = "3, 4"
julia = "1"

[extras]
Expand Down
12 changes: 6 additions & 6 deletions test/parse.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using MathML, EzXML, Symbolics, SpecialFunctions, IfElse, AbstractTrees, Test

using Symbolics: variable
# these tests mimic the README examples
fn = "data/math.xml"
doc = readxml(fn)
Expand Down Expand Up @@ -213,26 +213,26 @@ str = """
@test isequal(MathML.parse_str(str), [x + y, 3, 7])

str = "<bvar><ci>x</ci></bvar>"
@test isequal(MathML.parse_str(str), (Num(Variable(:x)), 1))
@test isequal(MathML.parse_str(str), (Num(variable(:x)), 1))

str = "<bvar><ci>x</ci><degree><cn>2</cn></degree></bvar>"
@test isequal(MathML.parse_str(str), (Num(Variable(:x)), 2))
@test isequal(MathML.parse_str(str), (Num(variable(:x)), 2))

str = """
<apply><diff/>
<bvar><ci>x</ci></bvar>
<apply><sin/><ci>x</ci></apply>
</apply>
"""
@test isequal(expand_derivatives(MathML.parse_str(str)), cos(Num(Variable(:x))))
@test isequal(expand_derivatives(MathML.parse_str(str)), cos(Num(variable(:x))))

str = """
<apply><diff/>
<bvar><ci>x</ci><degree><cn>2</cn></degree></bvar>
<apply><power/><ci>x</ci><cn>4</cn></apply>
</apply>
"""
@test isequal(expand_derivatives(MathML.parse_str(str)), 12 * Num(Variable(:x))^2)
@test isequal(expand_derivatives(MathML.parse_str(str)), 12 * Num(variable(:x))^2)

# macro test
ml = MathML"""
Expand All @@ -241,7 +241,7 @@ ml = MathML"""
<apply><power/><ci>x</ci><cn>4</cn></apply>
</apply>
"""
@test isequal(expand_derivatives(ml), 12 * Num(Variable(:x))^2)
@test isequal(expand_derivatives(ml), 12 * Num(variable(:x))^2)

str = """
<lambda>
Expand Down

0 comments on commit 4111c32

Please sign in to comment.