Skip to content

Commit

Permalink
Add tests for convenience rewrite function
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Apr 29, 2017
1 parent 2a4db28 commit 096908e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MathParserTests/RewriterTests.swift
Expand Up @@ -18,6 +18,10 @@ func TestRewrite(_ original: String, expected: String, substitutions: Substituti
let rewritten = rewriter.rewriteExpression(originalE, substitutions: substitutions, evaluator: evaluator)

XCTAssertEqual(rewritten, expectedE, file: file, line: line)

// Also test that the convenience functions produces the same result.
let convenienceRewritten = originalE.rewrite(substitutions, rewriter: rewriter, evaluator: evaluator)
XCTAssertEqual(convenienceRewritten, rewritten)
}

class RewriterTests: XCTestCase {
Expand Down

0 comments on commit 096908e

Please sign in to comment.