From 116eab8e7a52d486a488f6d8bbfa9d2d632bd2e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 3 Dec 2024 10:36:09 +0100 Subject: [PATCH] test-format-table: add test for unsetting table name This should extend coverage to another part that previously wasn't covered. --- src/test/test-format-table.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/test-format-table.c b/src/test/test-format-table.c index 1660b83c31d..3bfbf1fc467 100644 --- a/src/test/test-format-table.c +++ b/src/test/test-format-table.c @@ -372,6 +372,8 @@ TEST(json) { TABLE_HEADER, "piep miau", TABLE_HEADER, "asdf", TABLE_SET_JSON_FIELD_NAME, "asdf-custom")); + ASSERT_OK(table_set_json_field_name(t, 2, "ZZZ")); + ASSERT_OK(table_set_json_field_name(t, 2, NULL)); ASSERT_OK(table_set_json_field_name(t, 2, "zzz")); ASSERT_OK(table_add_many(t, @@ -715,6 +717,8 @@ TEST(vertical) { TABLE_FIELD, "quux", TABLE_STRING, "asdf", TABLE_SET_JSON_FIELD_NAME, "custom-quux", TABLE_FIELD, "lllllllllllo", TABLE_STRING, "jjjjjjjjjjjjjjjjj")); + ASSERT_OK(table_set_json_field_name(t, 1, "DIMPFELMOSER")); + ASSERT_OK(table_set_json_field_name(t, 1, NULL)); ASSERT_OK(table_set_json_field_name(t, 1, "dimpfelmoser")); ASSERT_OK(table_format(t, &formatted)); -- 2.47.3