vtest "vinyltop coverage"

server s1 {
	rxreq
	txresp
} -start

vinyl v1 -vcl+backend { } -start

client c1 {
	txreq
	rxresp
} -run

shell -expect "fetch" "vinyltop -n ${v1_name} -1"
shell -expect "fetch" {VINYL_DEFAULT_N="${v1_name}" vinyltop  -1}

process p1 "vinyltop -n ${v1_name} -d" -start
delay 1
process p1 -screen_dump -expect-text 0 0 fetch
process p1 -write q -wait

# without -f
shell -match "1\\.00 RespHeader Date: [^\\n]+\\n" {
	vinyltop -n ${v1_name} -1 -i RespHeader
}

# with -f
shell -match "1\\.00 RespHeader Date\\n" {
	vinyltop -n ${v1_name} -1 -f -i RespHeader
}

shell -match "Usage: .*vinyltop <options>" \
	"vinyltop -h"

shell -err -match "Usage: .*vinyltop <options>" \
	"vinyltop -K"

shell -expect "Copyright (c) 2006 Verdens Gang AS" \
	"vinyltop -V"

shell -err -match "Usage: .*vinyltop <options>" \
	"vinyltop extra"

shell -err -match "is not a number" \
	"vinyltop -p 60 -p 12ABC"
