Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siguici/vut
VUT is a lightweight framework for rule validation and unit testing in Vlang. Simplify code correctness checks, data validation, and unit testing in your V projects with this efficient tool.
https://github.com/siguici/vut
assert assertions assurances ensure expect expectations filters sanitization sanitizers schema test-suite test-suites testing-framework unit-testing validation validators vlang vlang-package vut
Last synced: 22 days ago
JSON representation
VUT is a lightweight framework for rule validation and unit testing in Vlang. Simplify code correctness checks, data validation, and unit testing in your V projects with this efficient tool.
- Host: GitHub
- URL: https://github.com/siguici/vut
- Owner: siguici
- License: mit
- Created: 2023-12-26T19:23:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-16T09:06:30.000Z (about 1 year ago)
- Last Synced: 2024-11-12T14:30:45.640Z (3 months ago)
- Topics: assert, assertions, assurances, ensure, expect, expectations, filters, sanitization, sanitizers, schema, test-suite, test-suites, testing-framework, unit-testing, validation, validators, vlang, vlang-package, vut
- Language: V
- Homepage: https://vpm.vlang.io/packages/siguici.vut
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# Validation and Unit Testing Framework for Vlang
VUT is a minimalistic framework for validating rules and conducting unit tests in Vlang.
Simplify code validation and ensure component correctness effortlessly.## Installation
- Install VUT using VPM (recommanded):
```shell
v install siguici.vut
```- Install VUT using Git:
```shell
mkdir ${V_MODULES:-$HOME/.vmodules}/siguici
git clone --depth=1 https://github.com/siguici/vut ${V_MODULES:-$HOME/.vmodules}/siguici/vut
```- Use VUT as a project dependency:
```v
Module {
//...
dependencies: [
'siguici.vut'
//...
]
}```
## Usage
### Filtering
```v
import vut { filter }assert filter(true).is_bool()
assert filter(true).is_true()
assert filter(2).is_any_int()
assert filter(5.4).is_any_float()
assert filter(8).is_num() // any_int or any_float
```### Assurance
```v
import vut { ensure }t := true
ensure(t).is_bool().is_true()
```### Expectation
```v
import vut { expect }t := true
expect(t).to_be_bool().to_be_true()
```