gjtorikian/mtex2MML — pull request #12 by gjtorikian (2014-10-18 20:20:16+00:00)
Title: Attempt mathjax parity

I couldn't understand why [the MathJax repo](https://github.com/mathjax/MathJax) didn't have any tests. After some snooping around, I hit :dollar:: there's a *separate* [MathJax-Test](https://github.com/mathjax/MathJax-test) repo.

This PR represents a port of MathJax's LaTeX to MML tests. Not only does it vastly improve coverage of this lib, but it also completely kicks the ass of KaTeX's coverage, too. :grin: A full list of the new changes can be found in the diff of [SUPPORTED.md](https://github.com/gjtorikian/mtex2MML/compare/attempt-mathjax-parity?expand=1#diff-2).

Generally, this PR:

* Ported over the TeX input and MathML output from MathJax's test suite
* Added a new test runner to iterate over those fixtures
* Updated the Bison grammar to individually support new command
* Ran Valgrind to make sure nothing catastrophic was being done

I hit and fixed few segmentation faults along the way. There's still a very slight bug that crops up in the array tests that I need to address. But whereas before I was pretty happy with this lib, I can now certifiably know what is (and isn't) supported compared to MathJax. Broadly, in LaTeX, you can [define new commands](https://en.wikibooks.org/wiki/LaTeX/Macros#New_commands). MathJax also supports this; this library does not. I've also skipped over a lot of weird notations dealing with sizing (like, you can change the font to be whatever size you want) out of a lack of interest. If it becomes an issue I can circle back to it.

@mdiep We had talked about reviewing some of the C going on. I'm not sure this PR is the best time to do so—I made a few earlier PRs to tweak some C code I'd written—and while this PR definitely gets closer to production-level, it contains very little C changes. Most of it was Bison grammar. So I am not sure how to talk through the full C changes to do a review `¯\_(ツ)_/¯`. Maybe in Gist I can send you the chunk I've written?

/cc @bkeepers @arfon