{"repo":"torokmark/assert.sh","free":true,"listed":false,"github":"https://github.com/torokmark/assert.sh","clone":"git clone https://github.com/torokmark/assert.sh.git","description":":exclamation: Assertion lib for shell script users","language":"Shell","stars":152,"topics":["shell","script","assertions","assertion-functions"],"license":"MIT","category":"cli-tools","readme_excerpt":"assert.sh Assert.sh is intended to give the assertion mechanism to shell scripts with well-known assert functions like assert eq , assert array eq , or assert empty . Inspired by Assert class of JUnit Install & Usage I. Clone the repository Or copy the assert.sh where your project is located. II. Edit the script where you would like to use asserts and paste the next line on the top: III. Now assert functions are available for use. 0 return status is considered true and anything else is considered false. List of assert functions assert eq takes two strings and checks whether they are the same based on the character strings. assert not eq is the opposite of assert eq . assert true takes a parameter and returns 0 confirming the parameter is true. assert false takes a parameter and decides whether it is false. assert array eq takes two arrays and compare them by items. assert array not eq takes two arrays and return 0 if the items are not the same on the same index. assert empty takes a string and returns 0 if it is empty assert not empty is the opposite of assert empty . assert contain checks whether the first argument contains the second one. assert not contain check whether the first argument does not contain the second one. assert gt checks whether the first param is greater than the second. assert ge checks whether the first param is greator than or equal to the second one. assert lt checks whether the first param is less than the second one. assert le checks whether the fir","default_branch":null,"files":null,"tree":[],"storefront":"/r/torokmark","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/torokmark/assert.sh/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}