Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
sigmasoldier

Twire - Unit testing made easy

Recommended Posts

Twire (Testing Wire) is a small and simple unit testing API made for running automated tests, this is useful if you're in the need of testing every time if your new added features, or the old ones keep going as intended.

Quote

unit testing is a software testing method by which individual units of source code

The repository: https://github.com/sigmasoldi3r/oc-twire

twire-v1-0-0.png.725c408c08afcde1e07b2db5274416d3.png

You may ask, why a testing suite?

The reason behind making a testing suite is because I was tired of making random test.lua files that included few prints to check if all was going OK, so this makes this process much more easy to understand, if something fails and easy to see that everything is going as expected. In fact, I was also motivated by the idea of making in a future test runners like in other programming languages and environments is done.

Installation

To install the version 1.0.0 which is the current beta release, just paste this code in your shell with the insert key: (Of course you'll need an internet card, and this is intended to run with a tier-3 GPU and screen)

Quote

Press enter and the library will be installed.

If this topic gets outdated any time, you can check the repository (Look at the top) to see if there are new releases, updates or issues solved.

If you have any issue or proposal you can post them at the repository issue tracker

You're welcome in contributing at any time!

Usage

In the readme you'll find a simple usage example, I'll give you a brief explanation here:

With the function describe you tell what you're doing or about to test, the second argument is the function inside the test.

With the function it you describe what it should do, then the second argument (again) is the function that will be tested for failed assertions.

Inside 'it', you assert conditions with the assert table of twire, like assert.equal(5, 6); which will result in a failed test because 5 == 6 will never be true (I hope so).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.