Skip to content

Commit

Permalink
Use is helper instead of grep
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Dec 30, 2017
1 parent 5f55886 commit f105f53
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load helpers
ytester -loop -serve "wave$YTAG"
running ynetd
! running ytester
ysend hello | grep -qFx "wave$YTAG"
is "`ysend hello`" = "wave$YTAG"
running ytester
close
! running ynetd
Expand Down
4 changes: 2 additions & 2 deletions test/port_forward.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ load helpers
ysend -timeout 1s hello | lines 0

# Tester on proxy port.
ysend -port "$PROXY_PORT" foo | grep -q "nocmd$YTAG"
is "`ysend -port "$PROXY_PORT" foo`" = "nocmd$YTAG"

ynetd -proxy ":$LISTEN_PORT localhost:$PROXY_PORT"
running ynetd

ysend -timeout 1s hello | grep -q "nocmd$YTAG"
is "`ysend -timeout 1s hello`" = "nocmd$YTAG"
kill "$tester" || :

ylog -y | grep -qF 'cmd: <nil>'
Expand Down
6 changes: 3 additions & 3 deletions test/reaper.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ load helpers

# kill and restart multiple times.
for i in 1 2 3; {
ysend hello | grep -qFx "reap$YTAG"
is "`ysend hello`" = "reap$YTAG"
running ytester
kill `ypidof ytester`

Expand All @@ -41,13 +41,13 @@ load helpers
running ynetd
! running ytester

ysend hello | grep -qFx "reap$YTAG"
is "`ysend hello`" = "reap$YTAG"
running ytester
kill -s CHLD $YPID

# The signal was fake, the process should still be running.
running ytester
# kill it, try again

ysend hello | grep -qFx "reap$YTAG"
is "`ysend hello`" = "reap$YTAG"
}
2 changes: 1 addition & 1 deletion test/stop.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ load helpers

# Use it.
for j in 1 2 3; {
ysend hello | grep -qFx "stop$YTAG"
is "`ysend hello`" = "stop$YTAG"
sleep 1
}

Expand Down
4 changes: 2 additions & 2 deletions test/timeout.bats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load helpers

start=`date +%s`
# This will wait.
ysend "hello" | grep -qFx "timely$YTAG"
is "`ysend "hello"`" = "timely$YTAG"
end=`date +%s`

is $end -ge $((start + 4))
Expand Down Expand Up @@ -45,5 +45,5 @@ load helpers
# Wait for listen to start.
sleep 2

ysend hello | grep -qFx "timely$YTAG"
is "`ysend hello`" = "timely$YTAG"
}

0 comments on commit f105f53

Please sign in to comment.