mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
format-table: add some minimal testing for new table_add_many() features
This commit is contained in:
parent
6268974f88
commit
8792cecc1f
@ -49,6 +49,7 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(table_add_many(t,
|
||||
TABLE_STRING, "a long field",
|
||||
TABLE_STRING, "yyy",
|
||||
TABLE_SET_UPPERCASE, 1,
|
||||
TABLE_BOOLEAN, false) >= 0);
|
||||
|
||||
assert_se(table_format(t, &formatted) >= 0);
|
||||
@ -57,7 +58,7 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(streq(formatted,
|
||||
"ONE TWO THREE\n"
|
||||
"xxx yyy yes\n"
|
||||
"a long field yyy no\n"));
|
||||
"a long field YYY no\n"));
|
||||
|
||||
formatted = mfree(formatted);
|
||||
|
||||
@ -69,7 +70,7 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(streq(formatted,
|
||||
"ONE TWO THREE\n"
|
||||
"xxx yyy yes\n"
|
||||
"a long field yyy no\n"));
|
||||
"a long field YYY no\n"));
|
||||
|
||||
formatted = mfree(formatted);
|
||||
|
||||
@ -80,7 +81,7 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(streq(formatted,
|
||||
"ONE TWO THR…\n"
|
||||
"xxx yyy yes\n"
|
||||
"a … yyy no\n"));
|
||||
"a … YYY no\n"));
|
||||
|
||||
formatted = mfree(formatted);
|
||||
|
||||
@ -114,7 +115,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
assert_se(streq(formatted,
|
||||
"ONE TWO THREE\n"
|
||||
"a long field yyy no\n"
|
||||
"a long field YYY no\n"
|
||||
"xxx yyy yes\n"));
|
||||
|
||||
formatted = mfree(formatted);
|
||||
@ -140,7 +141,7 @@ int main(int argc, char *argv[]) {
|
||||
printf("%s\n", formatted);
|
||||
|
||||
assert_se(streq(formatted,
|
||||
"a long field yyy no\n"
|
||||
"a long field YYY no\n"
|
||||
"fäää zzz no\n"
|
||||
"fäää uuu yes\n"
|
||||
"xxx yyy yes\n"
|
||||
|
Loading…
Reference in New Issue
Block a user