Skip to content

A library that provides Design by Contract like APIs to ensure functions adhere to specific preconditions and postconditions.

License

Notifications You must be signed in to change notification settings

Eyal-WowHub/Contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Contracts

A library that provides Design by Contract like APIs to ensure functions adhere to specific preconditions and postconditions.

Dependencies: LibStub

Example:

local C = LibStub("Contracts-1.0")

local function Divide(numerator, denominator)
   C:IsNumber(numerator, 1)
   C:IsNumber(denominator, 2)
   
   C:Ensures(denominator ~= 0, "Divided by zero. The denominator cannot be zero.")
   
   return numerator / denominator
end

About

A library that provides Design by Contract like APIs to ensure functions adhere to specific preconditions and postconditions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages