scalaz/scalaz-stream — pull request #248 by fthomas (2014-09-24 18:03:32+00:00)
Title: Test examples in ScalaDocs with sbt-doctest

This PR uses [sbt-doctest](https://github.com/tkawachi/sbt-doctest) to test the examples we currently have in the ScalaDocs of `process1.scala`. This means that all those examples are part of the test suite and tested on every test run. See below for the output of the corresponding test that is generated for `process1.scala`.

The nice things about sbt-doctest are:
- the examples are *correct* and in sync with the code
- the examples are written like ordinary REPL sessions
- there are no special ScalaDoc instructions for sbt-doctest

If this is merged, I'm going to add more examples to the not-so-obvious combinators in `process1`.

```
[info] process1Doctest:
[info] process1.scala:60: chunkBy
[info] - example at line 64: Process(1, 2, -1, 3, 4).chunkBy(_ > 0).toList
[info] process1.scala:216: fold
[info] - example at line 225: Process(1, 2, 3, 4).fold(0)(_ + _).toList
[info] process1.scala:264: intersperse
[info] - example at line 267: Process(1, 2, 3).intersperse(0).toList
[info] process1.scala:375: reduce
[info] - example at line 380: Process(1, 2, 3, 4).reduce(_ + _).toList
[info] - example at line 383: Process(1).reduce(_ + _).toList
[info] - example at line 386: Process[Int]().reduce(_ + _).toList
[info] process1.scala:410: repartition
[info] - example at line 417: Process("Hel", "l", "o Wor", "ld").repartition(_.split(" ")) ...
[info] process1.scala:467: scan1
[info] - example at line 470: Process(1, 2, 3, 4).scan1(_ + _).toList
[info] - example at line 473: Process(1).scan1(_ + _).toList
[info] - example at line 476: Process[Int]().scan1(_ + _).toList
[info] process1.scala:520: sliding
[info] - example at line 526: Process(1, 2, 3, 4).sliding(2).toList
[info] process1.scala:560: splitWith
[info] - example at line 564: Process(1, 2, -3, -4, 5, 6).splitWith(_ < 0).toList
```