Giter VIP home page Giter VIP logo

smlunit's Introduction

smlunit

This is a simple test framework, which will be improved with additional helper functions throughout the course on сoursera.org

This is a simple and useful test framework, which use only SML. And you can write simple tests right now! Congratulation!

How can you write tests?

  • You can separate tests from realization in separate files

  • For simple example of using. I created next structure in samples folder

    • sample1.sml - simple file with with realiztion of your functions
    • sample1tests.sml - simple tests file for sample1.sml unit
    • lib - folder for our powerfull :) smlunit library

Sample of tests

Each line of test file must be ended by semicolon!

sample1tests.sml
use "lib\\smlunit.sml";
use "sample1.sml";

test("should return 7 as result of addition", isTrue(addition(3,4) = 7));
test("should return 25 as result of multiplying", isTrue(multiplication(5,5) = 25));
sample1.sml
fun addition(num1 : int, num2 : int) =
    num1 + num2

fun multiplication(num1 : int, num2 : int) =
    num1 * num2

smlunit's People

Contributors

cyberlight avatar

Watchers

 avatar

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.