||3 years ago|
|LICENSE||3 years ago|
|README.md||3 years ago|
|fbla||3 years ago|
|test_fbla||3 years ago|
A Bash library of assertions
Table of contents
|assert_isinstance||checks if a variable correponds to a data type||every input evaluates to a string. Python 3 data type names are used for type identification|
- every element between
>is to be considered pseudocode.
- list of values are presented in this format:
'value a','value b','value n'
prototype: assert_isinstance(value,type) input: value = <any value including an empty string> type = 'bool','int','str' output: return 0 <if true> return 1 <if false>
See all fbla releases.
You can adapt and include the library as a separate part of your
program by using
source ./fbla or
. ./fbla from the main
To allow inclusion in any project the template and its documentation is released under the CC0 1.0 license.
Bashisms are Bash specific syntax elements. I decided to use these because of programming convenience rather than compliancy.
You will find at least the following bashisms in the library
|regual expresion binary operator||
GNU Bash "strict mode"
This template enables the shell's "strict mode".
You can disable it by commenting or removing the following line inside
set -euo pipefail
The following elements should be common sense and not be specific to fbopt
|all constants are enclosed within single quotes||elements within single quotes (only) are not interpreted by the shell||
|some variables are enclosed within double quotes||double quotes serve as a delimiter between multiple variable names if these are consecutive. Every variable between the quotes is interpolated||
|some variables are not enclosed within double quotes||the only variables allowed without double quotes are integers (such as return values) and loop iterators (because these won't work otherwise)||
|all variables use the curly braces notation||curly braces serve as a delimiter between multiple variable names if these are consecutive||
|all variable names with a constant value must be capital case||you might want to load some constants from a configuration file to override the values of options within the fbopt file||
The template is known to work with the the packages listed here. These must be of course installed on your system.
|Package||Executable||Version command||Package Version|
You can run tests like this:
These also serve as usage example.
Software using fbla
Written in 2019 by Franco Masotti/frnmst email@example.com
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.