Skip to content
Handy utils for writing tests in V lang
V
Branch: master
Clone or download
Latest commit 6a3ada0 Oct 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Oct 19, 2019
LICENSE
README.md
vtest.png
vtest.v
vtest_test.v

README.md

vtest 0.1.0

Handy unils for writing tests in V language.

This lirary provides several assert_*** functions which enhance the possibilites of builtin assert statement, giving the colored diff of expected and gotten value.

When generic functions will be available in V, concrete assert_eq_str and assert_eq_int will be replaced with one assert_eq function.

screenshot

The version of this module will remain in 0.x.x unless the language API's are finalized and implemented.

Examples

import popzxc.vtest

fn test_fail_str() {
    assert vtest.assert_eq_str("hello world", "hello wolrd")
}

fn test_fail_int() {
    assert vtest.assert_eq_int(1000, 2000)
}

fn test_fail_true() {
    assert vtest.assert_true(false)
}

fn test_fail_false() {
    assert vtest.assert_false(true)
}

Installaction

Via vpm:

v install popzxc.vtest

Via vpkg:

vpkg get https://github.com/popzxc/vtest

Contributing

Feel free to open pull requests!

License

MIT

You can’t perform that action at this time.