Skip to content

Commit

Permalink
Add docs to helpers functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Sep 16, 2023
1 parent 53417ad commit 5843b42
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/helpers.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

#
# @param string Eg: "test_some_logic"
# @param $1 string Eg: "test_some_logic_camelCase"
#
# @result string Eg: "Some logic"
# @result string Eg: "Some logic camelCase"
#
function Helper::normalizeTestFunctionName() {
local original_function_name="$1"
Expand All @@ -21,6 +21,13 @@ function Helper::normalizeTestFunctionName() {
echo "$result"
}

#
# @param $1 string Eg: "prefix"
# @param $2 string Eg: "filter"
# @param $3 array Eg: "[fn1, fn2, prefix_filter_fn3, fn4, ...]"
#
# @result array Eg: "[prefix_filter_fn3, ...]" The filtered functions with prefix
#
function Helper::getFunctionsToRun() {
local prefix=$1
local filter=$2
Expand Down Expand Up @@ -52,6 +59,9 @@ function Helper::getFunctionsToRun() {
echo "${functions_to_run[@]}"
}

#
# @param $1 string Eg: "do_something"
#
function Helper::executeFunctionIfExists() {
local function_name=$1

Expand All @@ -60,6 +70,9 @@ function Helper::executeFunctionIfExists() {
fi
}

#
# @param $1 string Eg: "do_something"
#
function Helper::unsetIfExists() {
local function_name=$1

Expand Down

0 comments on commit 5843b42

Please sign in to comment.