2 PSPP - a program for statistical analysis.
3 Copyright (C) 2017 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "ui/syntax-gen.h"
26 test_runner (const char *format, ...)
30 va_start (args, format);
32 ds_init_empty (&syntax);
34 syntax_gen_pspp_valist (&syntax, format, args);
38 puts (ds_cstr (&syntax));
46 test_runner ("A simple string: %ssEND", "Hello world");
47 test_runner ("A syntax string: %sqEND", "Hello world");
48 test_runner ("A syntax string containing \": %sqEND", "here\"is the quote");
49 test_runner ("A syntax string containing non-printables: %sqEND", "A CtrlL
\fchar");
50 test_runner ("An integer: %dEND", 98765);
51 test_runner ("A floating point number: %gEND", 3.142);
52 test_runner ("A floating point number with default precision: %fEND", 1.234);
53 test_runner ("A floating point number with given precision: %.20fEND", 1.234);
54 test_runner ("A literal %%");
56 test_runner ("and %ss a %sq of %d different %f examples %g of 100%% conversions.",
57 "finally", "concatination", 6, 20.309, 23.09);