Commit Graph

12 Commits

Author SHA1 Message Date
andvar cdc507f0d2 fix various typos in comment, documentation and log messages. 2022-05-24 20:50:17 +00:00
kre 8a7b619378 With the (very) recent changes to printf(1), a numeric conversion from data
of the form '+1 (two (or more) characters after the quote) will now generate
an error message, and cause printf(1) to exit(1) when it is done.

Adapt the test cases which use that data form to handle that.
2021-05-19 22:45:49 +00:00
kre 392642ae5f Fix a truly embarrassing quoting screwup. There is an explanation as
to why this didn't cause any failures, but I won't go into it here.
This was detected by the about to be committed printf changes.

While here also correct a couple of minor comment layout issues.
2021-05-19 22:20:34 +00:00
kre 0bcbd6c97f ATF runs shell script tests with "sh -e" (WHY???)
Compensate for that by adding an explicit test to a command so
-e will not kill the shell when the command (expectedly) fails.

Previously this was saved by /bin/sh disabling -e in command subs.
2020-04-24 14:29:19 +00:00
kre 5bb52324f6 Add a missing ("quoting") '>' in an atf_fail error message string.
Since the tests don't (usually) fail no-one ever noticed the missing char.

That is, the "received this" and "expected this" strings were supposed
to appear in the output err message as "<<string>>" but one of those
closing '>' chars was missing.

No-one should ever notice this change in normal operation, as the tests
are not intended to fail.
2019-11-12 18:59:51 +00:00
kre 311f349816 Stop assuming that printf handles options in any way at all
(it doesn't - that is, shouldn't) which includes processing -- as an
"end of options".  The first arg is (always) the format string.

Remove/fix tests that assumed the contrary.

Problem (with printf) pointed out on tech-userlevel by Thierry Laronde.
2019-07-21 15:25:59 +00:00
kre da8bc57f2b Correct a typo. It is atf_require_prog not atf_require_pfog ... 2019-07-21 15:00:18 +00:00
kre 30a7129418 Move the tests of character value args to floating conversions
out of the %e test and into the NetBSD specific tests, while POSIX
once (apparently) required (or seemed to require) support for that,
it no longer does (and character value args to float conversions do
not make much sense - char valuse are always integers).

When char conversions are supported, test that \'  (or \" ) (that is,
no character following the quote) works as an arg (should result in zero,
as there's a \0 in the arg after the quote char).

Add some big/small number %g conversion tests.
2018-09-14 19:57:57 +00:00
kre fdc5bd383d When the shell being tested for builtin printf supports "type -t"
use it to test if printf is built in, it is must more reliable that
guessing at the output format and message of "type" (without -t).
2018-09-14 19:52:23 +00:00
kre 15c15cae0c Add a test where printf is run twice in the same shell, and the
first invocation uses \c in a %b arg - make sure that 2nd invocation
is not affected by that  (it was until recently, for a very long time).
2018-09-10 15:02:11 +00:00
kre ecfbb4457e Make sure we're in the standard locale when testing for printf
being built in to the shell, so we don't receive an unrecognisable
(to the script) message from the shell when we ask it.
2018-09-08 18:24:01 +00:00
kre d1e529d31c Add ATF tests for printf(1)
Two new test programs, one for the version of printf in /bin/sh
and one for the command /usr/bin/printf (t_builtin and t_command)

Each test program has 28 test cases (the same in each) of which
currently 27 pass, and 1 is skipped.

See the test scripts themselves for more information.
2018-09-05 21:05:40 +00:00