Merge branch 'ds/t7700-kept-pack-test'
Test clean-up. * ds/t7700-kept-pack-test: test-lib-functions: remove test_subcommand_inexact t7700: check post-condition in kept-pack test
This commit is contained in:
@ -1864,40 +1864,6 @@ test_subcommand () {
|
||||
fi
|
||||
}
|
||||
|
||||
# Check that the given command was invoked as part of the
|
||||
# trace2-format trace on stdin, but without an exact set of
|
||||
# arguments.
|
||||
#
|
||||
# test_subcommand [!] <command> <args>... < <trace>
|
||||
#
|
||||
# For example, to look for an invocation of "git pack-objects"
|
||||
# with the "--honor-pack-keep" argument, use
|
||||
#
|
||||
# GIT_TRACE2_EVENT=event.log git repack ... &&
|
||||
# test_subcommand git pack-objects --honor-pack-keep <event.log
|
||||
#
|
||||
# If the first parameter passed is !, this instead checks that
|
||||
# the given command was not called.
|
||||
#
|
||||
test_subcommand_inexact () {
|
||||
local negate=
|
||||
if test "$1" = "!"
|
||||
then
|
||||
negate=t
|
||||
shift
|
||||
fi
|
||||
|
||||
local expr=$(printf '"%s".*' "$@")
|
||||
expr="${expr%,}"
|
||||
|
||||
if test -n "$negate"
|
||||
then
|
||||
! grep "\"event\":\"child_start\".*\[$expr\]"
|
||||
else
|
||||
grep "\"event\":\"child_start\".*\[$expr\]"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check that the given command was invoked as part of the
|
||||
# trace2-format trace on stdin.
|
||||
#
|
||||
|
Reference in New Issue
Block a user