Re: [PATCH 2/3] test: Add `test_emacs_expect_t'.

Subject: Re: [PATCH 2/3] test: Add `test_emacs_expect_t'.

Date: Thu, 19 Jan 2012 09:59:16 +0000

To: Tomi Ollila, notmuch@notmuchmail.org

Cc:

From: David Edmondson


On Wed, 18 Jan 2012 16:55:59 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> > +	# Report success/failure.
> > +	if ! test_skip "$test_subtest_name"
> > +	then
> > +		if [ "$result" == t ]
> 
> 		if [ "$result" = t ]
> 
> to be compatible with POSIX and consistent with rest code.

I'm happy to change this.

> > +			test_failure_ "$test_subtest_name" "$(eval printf ${result})"
> 
> This added 'eval' made me investigate further... running 
> 
> emacsclient --eval '(print (concat "a" "b" "\t" "c" "\n" "z"))'
> 
> outputs "ab	c\nz" (tab between 'ab' and 'c', quotes (") around
> the whole output and newlines as "\n" (even '\r' is converted)).
> 
> If emacs tests run via test_emacs_expect_t wrote their output 
> to ${output} directly above code could be much cleaner in many
> places. Environment variable could be used for the file name.

I'm reluctant to change this just to avoid calling eval.
part-000.sig (application/pgp-signature)

Thread: