Want to contribute? Fork us in GitHub!

Unit Testing with 'eoc'

There is eoc, a command line tool that helps you automate compilation, transpilation, and execution of simple EO programms. With this tool you can also create and execute unit tests. Just name them *-test.eo and add metas +junit to them.

Say, you have a program.eo file, which does this:

[] > name
  "Jeff Lebowski" > @
[args...] > program
  QQ.io.stdout > @

You may want to create a unit test, which will check that your object name actually is the right name. Put it into the program-test.eo file (actually, you can pick any name of the file you like):

+alias name
+alias org.eolang.hamcrest.assert-that

[] > the-name-is-right
  assert-that > @
      $.greater-than 10
      $.less-than 100

Then, simply say:

$ eoc test

The test will be found and executed.