Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test of get_list type #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/test_bash_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ test_display_e() {
assertEquals "${expected_return_code}" "${actual_return_code}"
}

test_get_list_type() {
expected="get_list is a function"
actual=$(type get_list | grep "is a")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about testing the return of get_list instead of checking the type? bash does not have a lot of types so it is probably not very informative.

There are currently 4 kinds of lists to be returned from get_list: flavor, build, application, and cmd. "flavor" and "cmd" may be more useful than others.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YenPeiChen07 any update?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YenPeiChen07 Another month passed. Is there any update?

assertEquals "${expected}" "${actual}"
}

test_get_cmd_list() {
expected=$(echo `${LS_PATH} -1 ../scripts/cmd.d/`)
actual=$(get_list cmd)
Expand Down