require "spec_helper"
RSpec.describe MathML2AsciiMath do
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
a diamond x^2 + b xx x + c_3
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
a diamond x^(2d) + b xx x + c_(ab)
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
(( 1 + sqrt( 5 ) ))/( 2 )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
( a + b )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
[ 0 , 1 )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
\u222B_0^( oo )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
\u222B_(ab)^(ds)
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
ubrace ( x + y + z )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
ul ( x + y + z )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
underset(fred)(( x + y + z ))
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
obrace x + y + z
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
hat x + y + z
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
bar x + y + z
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
vec x + y + z
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
dot x + y + z
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
ddot x + y + z
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
overset(fred)( x + y + z )
OUTPUT
end
it "processes some MathML" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
X = [[A,B],[C,D],[E,F]]
OUTPUT
end
it "processes wrapping element" do
expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
INPUT
bar lambda ( t_1 , t_2 )
OUTPUT
end
it "processes