Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions spec/eeeval_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ describe EEEval::CalcParser do
expression.should eq(-199.99999999999997)
end
end

describe "#convert_multdiv_sign" do
it "should correctly handle multiplication with a negative number" do
expression = "2*-0.5"
result = EEEval::CalcParser.convert_multdiv_sign(expression)
result.should eq("2*(0-0.5)")
end

it "should correctly handle division with a negative number" do
expression = "2/-0.5"
result = EEEval::CalcParser.convert_multdiv_sign(expression)
result.should eq("2/(0-0.5)")
end
end
end

describe EEEval::MathFuncResolver do
Expand Down