Skip to content

Commit

Permalink
Move sharness test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavila committed May 6, 2019
1 parent bd7629d commit b7912d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
21 changes: 0 additions & 21 deletions test/sharness/lib/iptb-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,3 @@ iptb_wait_stop() {
go-sleep 10ms
done
}

findprovs_empty() {
test_expect_success 'findprovs '$1' succeeds' '
ipfsi 1 dht findprovs -n 1 '$1' > findprovsOut
'

test_expect_success "findprovs $1 output is empty" '
test_must_be_empty findprovsOut
'
}

findprovs_expect() {
test_expect_success 'findprovs '$1' succeeds' '
ipfsi 1 dht findprovs -n 1 '$1' > findprovsOut &&
echo '$2' > expected
'

test_expect_success "findprovs $1 output looks good" '
test_cmp findprovsOut expected
'
}
21 changes: 21 additions & 0 deletions test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,24 @@ convert_tcp_maddr() {
port_from_maddr() {
echo $1 | awk -F'/' '{ print $NF }'
}

findprovs_empty() {
test_expect_success 'findprovs '$1' succeeds' '
ipfsi 1 dht findprovs -n 1 '$1' > findprovsOut
'

test_expect_success "findprovs $1 output is empty" '
test_must_be_empty findprovsOut
'
}

findprovs_expect() {
test_expect_success 'findprovs '$1' succeeds' '
ipfsi 1 dht findprovs -n 1 '$1' > findprovsOut &&
echo '$2' > expected
'

test_expect_success "findprovs $1 output looks good" '
test_cmp findprovsOut expected
'
}

2 comments on commit b7912d7

@GitCop
Copy link

@GitCop GitCop commented on b7912d7 May 6, 2019

Choose a reason for hiding this comment

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

There were the following issues with your Pull Request

We ask for a few features in the commit message for Open Source licensing hygiene and commit message clarity.
git commit --amend can often help you quickly improve the commit message.
Guidelines and a script are available to help in the long run.
Your feedback on GitCop is welcome on this issue.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link

@GitCop GitCop commented on b7912d7 May 6, 2019

Choose a reason for hiding this comment

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

There were the following issues with your Pull Request

We ask for a few features in the commit message for Open Source licensing hygiene and commit message clarity.
git commit --amend can often help you quickly improve the commit message.
Guidelines and a script are available to help in the long run.
Your feedback on GitCop is welcome on this issue.


This message was auto-generated by https://gitcop.com

Please sign in to comment.