Created
October 5, 2011 20:16
-
-
Save basicxman/1265555 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FractionsParsingTest < Test::Unit::TestCase | |
| def test_complex_fractions | |
| result = parse('(((x+2)(x-3)) / ((x-2)(x+2))) / (((x-1)(x-1))/((x-1)(x+1)))') | |
| expected = '\dfrac{(x+2)(x-3)}{(x-2)(x+2)}\ \div\ \dfrac{(x-1)(x-1)}{(x-1)(x+1)}' | |
| assert_equal expected, result | |
| end | |
| def test_single_complex_fraction | |
| result = parse('(x^2+3) / (x^2-3)') | |
| expected = '\dfrac{x^2+3}{x^2-3}' | |
| assert_equal expected, result | |
| end | |
| def test_simple_fractions | |
| result = parse('(x^2 -6+4)/(x^3)/(x^4)') | |
| expected = '\dfrac{x^2-6+4}{\dfrac{x^3}{x^4}}' | |
| assert_equal expected, result | |
| end | |
| def test_simple_fraction | |
| result = parse('x/y') | |
| expected = '\dfrac{x}{y}' | |
| assert_equal expected, result | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment