comet

A language built for fun

This project is maintained by cometlang

up

unittest

A basic unit testing framework

Can be run as a script to run other tests. All functions in the module that start with the name test_ are determined to be tests to run.

test_script.cmt:

import 'unittest' as unittest

function test_a_thing() {
    unittest.Assert.that('this is a string').is_not_nil()
}

comet unittest [--coverage] test_script.cmt

The script will exit with a non-zero exit code if any of the tests fail.

If the --coverage parameter is specified, then a json document with the count of the number of times each line was executed, along with the per-function and per-file totals and percentages called .coverage.json in the current directory is created.

classes

static methods

methods