Git Product home page Git Product logo

narrativetest.jl's Introduction

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:

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

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

using NarrativeTest
NarrativeTest.runtests()

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

using Test, NarrativeTest

@testset "MyPackage" begin
    
    NarrativeTest.testset()
    
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:

# Sample test suite

Verify that the expression evaluates to the expected value:

    6(3+4)          #-> 42

Check if the code produces the expected output:

    print("Hello ")
    print("World!")
    #-> Hello World!

Abbreviate the output with ellipsis:

    collect('a':'z')
    #-> ['a', 'b', …, 'z']

    display(collect('a':'z'))
    #=>
    26-element Array{Char,1}:
     'a'
     'b'
    
     'z'
    =#

To test your package, run:

$ julia ./test/runtests.jl

For more information, see the Documentation.

narrativetest.jl's People

Contributors

clarkevans avatar vtjnash avatar xitology avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

narrativetest.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.