项目作者: MechanicalRabbit

项目描述 :
Julia library for functional testing.
高级语言: Julia
项目地址: git://github.com/MechanicalRabbit/NarrativeTest.jl.git
创建时间: 2017-10-04T22:41:52Z
项目社区:https://github.com/MechanicalRabbit/NarrativeTest.jl

开源协议:MIT License

下载


NarrativeTest.jl

NarrativeTest is a Julia library for functional testing, which lets you write
the test suite in the narrative form. It permits you to describe the behavior
of software components in the Markdown format, and then extract, execute, and
validate any embedded test code.

Build Status
Code Coverage Status
Open Issues
Documentation
MIT License

Quick Start

Install the package using the Julia package manager:

  1. julia> using Pkg
  2. julia> Pkg.add("NarrativeTest")

Add NarrativeTest to your package as a test-specific
dependency
.
Then create the following test/runtests.jl:

  1. using NarrativeTest
  2. NarrativeTest.runtests()

If you are already relying on the standard Test library, you can add
NarrativeTest as a nested test set:

  1. using Test, NarrativeTest
  2. @testset "MyPackage" begin
  3. NarrativeTest.testset()
  4. end

Write the test suite in Markdown and save it in the test directory. Place
the test code in Markdown code blocks, and use comments #-> … and #=> … =#
to indicate the expected output. For example:

  1. # Sample test suite
  2. Verify that the expression evaluates to the expected value:
  3. 6(3+4) #-> 42
  4. Check if the code produces the expected output:
  5. print("Hello ")
  6. print("World!")
  7. #-> Hello World!
  8. Abbreviate the output with ellipsis:
  9. collect('a':'z')
  10. #-> ['a', 'b', …, 'z']
  11. display(collect('a':'z'))
  12. #=>
  13. 26-element Array{Char,1}:
  14. 'a'
  15. 'b'
  16. 'z'
  17. =#

To test your package, run:

  1. $ julia ./test/runtests.jl

For more information, see the Documentation.