[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 3/3] mllib: tests: Add tests of the new Getopt module.



On Friday, 15 July 2016 22:37:29 CEST Richard W.M. Jones wrote:
> ---

Good idea, just a couple of notes.

> +(* Test the Getopt module.  The tests are controlled by the
> + * test-getopt.sh script.
> + *)
> +
> +open Printf
> +
> +open Common_utils

Theoretically Getopt is not tied to Common_utils, so it could be tested
without it.

> +
> +t=./getopt_tests
> +
> +expect_fail ()
> +{
> +    if "$@"; then
> +        echo "$@" ": this command was expected to exit with an error"
> +        exit 1
> +    fi
> +}
> +
> +# Program works.
> +$t

Just wondering whether GNU expect could be used here.

Thanks,
-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]