aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/scala/org/perl8/test/PlanTest.scala
blob: e467c2f9615a2aa03f337c83976b041e8bfc184d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.perl8.test

import java.io.ByteArrayOutputStream

import org.perl8.test.tap.Parser

class PlanTest extends TestMore {
  private class PlanTestTest extends TestMore(2) {
    is(1, 1)
    is(2, 2)
  }

  val out = new ByteArrayOutputStream
  val exitCode = Console.withOut(out) {
    Console.withErr(out) {
      (new PlanTestTest).run
    }
  }

  is((new Parser).parse(out).exitCode, 0)
  is(exitCode, 0)

  val tap =
    "1..2\n" +
    "ok 1\n" +
    "ok 2\n"

  is(out.toString, tap)
}