Giter Site home page Giter Site logo

ciavash / t Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 26 KB

Raku module for writing test assertions which output good test descriptions and error messages

Home Page: https://codeberg.org/CIAvash/T

License: GNU Lesser General Public License v3.0

Raku 100.00%
raku rakulang module raku-module testing assertions assertion slang library

t's Introduction

NAME

T - An easy way of writing test assertions which output good test descriptions and error messages

DESCRIPTION

T is a Raku module for writing test assertions which output good test descriptions and error messages.

It provides the t keyword for writing test assertions which takes an expression of form <got> <infix> <expected>.

Goals of the module:

  • Write less but more readable test code
  • Get a useful test description and failure message

SYNOPSIS

use T:auth<zef:CIAash>;

t 4 == 4;
=output ok 1 - 4 == 4

t $my_great_module.return('something') eq 'something';
=output ok 2 - $my_great_module.return('something') eq 'something'

t $my_great_module.return('something else') eq 'something';
=output not ok 3 - $my_great_module.return('something else') eq 'something'
# Failed test '$my_great_module.return('something else') eq 'something''
# at ... line ...
# expected: "something"
#  matcher: 'infix:<eq>'
#      got: "something else"

INSTALLATION

You need to have Raku and zef, then run:

zef install --/test "T:auth<zef:CIAvash>"

or if you have cloned the repo:

zef install .

TESTING

prove6 -I. -v

or:

prove -ve 'raku -I.' --ext rakutest

REPOSITORY

https://codeberg.org/CIAvash/T/

BUG

https://codeberg.org/CIAvash/T/issues

AUTHOR

Siavash Askari Nasr - https://siavash.askari-nasr.com

COPYRIGHT

Copyright © 2022 Siavash Askari Nasr

LICENSE

This file is part of T.

T is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at yoption) any later version.

T is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with T. If not, see http://www.gnu.org/licenses/.

t's People

Contributors

ciavash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.