Skip to main content

Posts

Showing posts with the label unittest

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

An Approach to Illiterate Programming: doc-code-merge

It's very common to embed code examples in technical documentation. However, doing so is kind of painful. First of all, the environment you use to edit the documentation may not be the same as the environment you use to write code. For instance, I generally use Dart Editor to write Dart code, but I use Sublime Text 2 to edit documentation written in HTML or Markdown. Secondly, it's difficult to run unit tests or use dart_analyzer if the code is trapped in documentation. This is a big problem for us on the Dart project because we move pretty quickly, and we want to make sure our documentation is always 100% correct. I've created a tool called doc-code-merge to solve this problem. doc-code-merge is the opposite of what Donald Knuth labelled Literate Programming . doc-code-merge lets you write your documentation and your code examples completely separately. When you run doc_code_merge.dart, it makes a copy of your documentation with all the examples merged in. The Pragmati...

New Article: Writing Unit Tests for Pub Packages

Don't know how to get started with testing your Dart code? This  new article  by Shailen Tuli provides a gentle introduction to creating a Dart package and writing unit tests for it.  Read this article to get started and then find out more about  Pub packages  and  Unit Testing with Dart . As always, we invite you to join our  Dart mailing list , ask questions on  Stack Overflow , or file feature requests on  dartbug.com .