Skip to content

Commit

Permalink
Add ohce sample and add it to funtests (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Oct 30, 2016
1 parent dfca493 commit c59499d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/samples/04-ohce.mgn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load std.prelude

main := reverse input
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,12 @@ class SamplesFuntest extends FlatSpec with Matchers with MorganeyProcess {

actualOutput should be (expectedOutput)
}

"ohcE sample" should "print the user's input backwards" in {
val input = new ByteArrayInputStream("Hello".getBytes("UTF-8"))
val expectedOutput = s"""string: \"olleH\"${System.lineSeparator()}"""
val actualOutput = morganey("./docs/samples/04-ohce.mgn") #< input !!

actualOutput should be (expectedOutput)
}
}

0 comments on commit c59499d

Please sign in to comment.