davedelong / DDMathParser

String → Number
MIT License
854 stars 153 forks source link

swift language unit tests #107

Closed keithtfs closed 9 years ago

keithtfs commented 9 years ago

So, to practice writing unit tests in Swift, I'm writing some tests for the swift code I found in this repository. I was going to translate the DDMathParser Objective-C code to Swift, but it seems you've already done that, even if it isn't "public" yet. Four questions:

  1. Is the swift code considered "stable" enough for unit testing?
  2. Do you want me to send you "pull requests" for the unit tests that I write? (assuming I figure out how to do pull requests correctly.)
  3. FYI - Since unit tests don't have access to "internal" members, I'm changing SOME of the internal members to "public" for testing purposes. I'd love to know if there is some way to put the unit tests into the "internal" scope, but I haven't yet heard of good way to do that yet.
  4. Is it OK with you if I write blog entries about my experience unit testing DDMathParser? This will involve publishing portions of the DDMathParser code as well my test code.

I appreciate your making DDMathParser open-source, and I'd like to publicize it a little.

davedelong commented 9 years ago
  1. Yes I try to keep the 2.0 branch stable, and I've been implementing unit tests for stuff as I write it. Some of the unit tests currently fail, as reminders to me of "stuff I haven't implemented yet" (mainly centered around rewriting expressions). Basic parsing, interpretation, and evaluation is all working.
  2. Sure!
  3. I think there was something about this at WWDC this year, on how to expose internal stuff for unit tests. I'll have to go look things up to make sure. What sorts of things are you wanting to publicize?
  4. Yeah, that seems fine with me. :)