[PATCH] test-tests: Add test to guarantee portability of other unit tests

Jim Hague jim.hague at acm.org
Tue Jan 26 05:47:49 CST 2010


On Monday 25 January 2010, Marti Raudsepp wrote:
> Also, even though Jim Hague in commit a19d2993385d claims that on AIX
> printf doesn't support \NNN escapes, I found that test-diffstat still
> passes with 'printf \0'. I asked someone in ##aix to confirm this
> problem, but they said that a \141 escape works, with /bin/sh and ksh,
> in AIX 5.3 and 6.1... So I added a special case for ignoring printf '\0'

I'm using AIX 5.2. Unfortunately I don't have access to AIX 5.3 or AIX 6 
systems.

It seems 'printf \0' does work on 5.2. In fact, it turns out printf can be 
made to give the desired output with 'printf \0374' (though, of course, on 
bash that produces '\037' '4').

$ printf '\374'
\374$ printf '\0'
$ printf '\0374'
�$

This is /usr/bin/ksh, the default shell, which on AIX 5.2 is ksh89. 
/usr/bin/ksh93 is available on AIX5.2 and does produce the desired output from 
'printf \374'. Perhaps the AIX 5.3 and later default shells are fixed or 
updated to ksh93.
-- 
Jim Hague - jim.hague at acm.org        Never trust a computer you can't lift.


More information about the Mercurial-devel mailing list