CLI interface to medialist (fossil mirror)
修訂 | 56eb31438d1861798b802417730960cd84d77b2f (tree) |
---|---|
時間 | 2023-03-09 11:04:06 |
作者 | mio <stigma@disr...> |
Commiter | mio |
Update unittests for nothrow versions
FossilOrigin-Name: c9c18cf87088755c69c8f59b89a3dba592c1aa83259845d72fbf96c5642e9215
@@ -123,7 +123,7 @@ unittest | ||
123 | 123 | MLError ec = ml_send_command(ml, MLCommand.add, ["Item 1"]); |
124 | 124 | assert(MLError.success == ec, "Failed to send ADD command [Item 1]."); |
125 | 125 | |
126 | - MediaListItem item1 = ml_fetch_item(ml, 1, &ec); | |
126 | + MediaListItem item1 = ml_fetch_item(ml, 1, ec); | |
127 | 127 | assert(MLError.success == ec, "Failed to FETCH id 1."); |
128 | 128 | assert(item1.startDate == "", "Non-empty start date for new item."); |
129 | 129 | assert(item1.endDate == "", "Non-empty end date for new item."); |
@@ -131,7 +131,7 @@ unittest | ||
131 | 131 | ec = ml_send_command(ml, MLCommand.update, ["1", "start_date::2021-11-25"]); |
132 | 132 | assert(MLError.success == ec, "Failed to send UPDATE command to change start date."); |
133 | 133 | |
134 | - item1 = ml_fetch_item(ml, 1, &ec); | |
134 | + item1 = ml_fetch_item(ml, 1, ec); | |
135 | 135 | assert(MLError.success == ec, "Failed to FETCH id 1."); |
136 | 136 | assert(item1.startDate == "2021-11-25", "Failed to update start date to '2021-11-25'."); |
137 | 137 | assert(item1.endDate == "", "Non-empty end date encountered"); |
@@ -139,7 +139,7 @@ unittest | ||
139 | 139 | ec = ml_send_command(ml, MLCommand.update, ["1", "end_date::2021-11-25"]); |
140 | 140 | assert(MLError.success == ec, "Failed to send UPDATE command to change end date."); |
141 | 141 | |
142 | - item1 = ml_fetch_item(ml, 1, &ec); | |
142 | + item1 = ml_fetch_item(ml, 1, ec); | |
143 | 143 | assert(MLError.success == ec, "Failed to FETCH id 1."); |
144 | 144 | assert(item1.startDate == "2021-11-25", "Failed to retain start date as '2021-11-25'."); |
145 | 145 | assert(item1.endDate == "2021-11-25", "Failed to update end date to '2021-11-25'."); |
@@ -176,7 +176,7 @@ unittest | ||
176 | 176 | |
177 | 177 | string currentDate = format!"%d-%02d-%02d"(date.year, date.month, date.day); |
178 | 178 | |
179 | - MediaListItem item = ml_fetch_item(ml, 1, &err); | |
179 | + MediaListItem item = ml_fetch_item(ml, 1, err); | |
180 | 180 | assert(MLError.success == err, "Failed to FETCH item ID 1."); |
181 | 181 | assert(item.lastUpdated == currentDate, |
182 | 182 | "'last_updated' field does not match the current date."); |
@@ -265,7 +265,7 @@ unittest | ||
265 | 265 | assert(null !is list, "Memory allocation failed (list is null)."); |
266 | 266 | assert(true == exists(listPath), "A new file wasn't created for the list."); |
267 | 267 | |
268 | - MediaListHeader[] headers = ml_fetch_headers(list, null); | |
268 | + MediaListHeader[] headers = ml_fetch_headers(list); | |
269 | 269 | assert(null !is headers, "Failed to parse headers"); |
270 | 270 | |
271 | 271 | foreach(const ref header; headers) { |
@@ -309,7 +309,7 @@ unittest | ||
309 | 309 | string currentDS = format!"%d-%02d-%02d"(currentD.year, |
310 | 310 | currentD.month, currentD.day); |
311 | 311 | |
312 | - MediaListHeader[] headers = ml_fetch_headers(list, null); | |
312 | + MediaListHeader[] headers = ml_fetch_headers(list); | |
313 | 313 | assert(null !is headers, "Failed to fetch headers from list."); |
314 | 314 | assert(sections.length == headers.length, |
315 | 315 | "Differing amount of headers in unit test file."); |
@@ -381,7 +381,7 @@ unittest | ||
381 | 381 | string currentDS = format!"%d-%02d-%02d"(currentD.year, |
382 | 382 | currentD.month, currentD.day); |
383 | 383 | |
384 | - MediaListHeader[] headers = ml_fetch_headers(list, null); | |
384 | + MediaListHeader[] headers = ml_fetch_headers(list); | |
385 | 385 | assert(null !is headers, "Failed to fetch headers from list."); |
386 | 386 | assert(sections.length == headers.length, |
387 | 387 | "Differing amount of headers in unit test file."); |
@@ -454,7 +454,7 @@ unittest | ||
454 | 454 | string currentDS = format!"%d-%02d-%02d"(currentD.year, |
455 | 455 | currentD.month, currentD.day); |
456 | 456 | |
457 | - MediaListHeader[] headers = ml_fetch_headers(list, null); | |
457 | + MediaListHeader[] headers = ml_fetch_headers(list); | |
458 | 458 | assert(null !is headers, "Failed to fetch headers from list."); |
459 | 459 | assert(sections.length == headers.length, |
460 | 460 | "Differing amount of headers in unit test file."); |
@@ -527,7 +527,7 @@ unittest | ||
527 | 527 | string currentDS = format!"%d-%02d-%02d"(currentD.year, |
528 | 528 | currentD.month, currentD.day); |
529 | 529 | |
530 | - MediaListHeader[] headers = ml_fetch_headers(list, null); | |
530 | + MediaListHeader[] headers = ml_fetch_headers(list); | |
531 | 531 | assert(null !is headers, "Failed to fetch headers from list."); |
532 | 532 | assert(sections.length == headers.length, |
533 | 533 | "Differing amount of headers in unit test file."); |
@@ -585,7 +585,7 @@ unittest | ||
585 | 585 | assert(MLError.success == ec, |
586 | 586 | `Failed to send MLCommand.add ["Item 2", "1/-", "READING"].`); |
587 | 587 | |
588 | - MediaListItem item2 = ml_fetch_item(list, 2, &ec); | |
588 | + MediaListItem item2 = ml_fetch_item(list, 2, ec); | |
589 | 589 | assert(MLError.success == ec, |
590 | 590 | `Failed to fetch item 2 (ec == ` ~ to!string(ec) ~ `).`); |
591 | 591 |
@@ -719,7 +719,7 @@ unittest | ||
719 | 719 | assert(MLError.success == res, |
720 | 720 | `Failed to send MLCommand.update ["1", "title::Item 1"].`); |
721 | 721 | |
722 | - MediaListItem item = ml_fetch_item(list, 1, &res); | |
722 | + MediaListItem item = ml_fetch_item(list, 1, res); | |
723 | 723 | assert(MLError.success == res, `Failed to fetch item 1 from list.`); |
724 | 724 | |
725 | 725 | assert("Item 1" == item.title, |
@@ -750,7 +750,7 @@ unittest | ||
750 | 750 | assert(MLError.success == res, |
751 | 751 | `Failed to send MLCommand.update ["1", "status::READING"].`); |
752 | 752 | |
753 | - MediaListItem item = ml_fetch_item(list, 1, &res); | |
753 | + MediaListItem item = ml_fetch_item(list, 1, res); | |
754 | 754 | assert(MLError.success == res, `Failed to fetch item 1 from list.`); |
755 | 755 | |
756 | 756 | assert("READING" == item.status, |
@@ -820,7 +820,7 @@ unittest | ||
820 | 820 | `"end_date::2022-01-20", "progress::60/100", "status::READING", ` ~ |
821 | 821 | `"title::MediaList"].`); |
822 | 822 | |
823 | - MediaListItem item = ml_fetch_item(list, 1, &res); | |
823 | + MediaListItem item = ml_fetch_item(list, 1, res); | |
824 | 824 | assert(MLError.success == res, `Failed to fetch item 1 from list.`); |
825 | 825 | |
826 | 826 | assert("MediaList" == item.title, |
@@ -859,7 +859,7 @@ unittest | ||
859 | 859 | res = ml_send_command(list, MLCommand.add, ["Item 1", null, "PLAN-TO-READ"]); |
860 | 860 | assert(MLError.success == res, `Failed to send add command ["Item 1", null, "PLAN-TO-READ"]`); |
861 | 861 | |
862 | - MediaListItem item1 = ml_fetch_item(list, 1, &res); | |
862 | + MediaListItem item1 = ml_fetch_item(list, 1, res); | |
863 | 863 | assert(MLError.success == res, `Failed to fetch item 1`); |
864 | 864 | |
865 | 865 | assert("" == item1.startDate, "New item with no provided start date is not blank"); |
@@ -868,7 +868,7 @@ unittest | ||
868 | 868 | res = ml_send_command(list, MLCommand.update, ["1", "status::READING"]); |
869 | 869 | assert(MLError.success == res, `Failed to send update command [1, status::READING]`); |
870 | 870 | |
871 | - item1 = ml_fetch_item(list, 1, &res); | |
871 | + item1 = ml_fetch_item(list, 1, res); | |
872 | 872 | assert(MLError.success == res, `Failed to fetch item 1`); |
873 | 873 | |
874 | 874 | assert("" != item1.startDate, "PLAN-TO-READ to READING does not change empty start date."); |
@@ -879,7 +879,7 @@ unittest | ||
879 | 879 | res = ml_send_command(list, MLCommand.update, ["1", "status::COMPLETE"]); |
880 | 880 | assert(MLError.success == res, `Failed to send update command [1, status::COMPLETE]`); |
881 | 881 | |
882 | - item1 = ml_fetch_item(list, 1, &res); | |
882 | + item1 = ml_fetch_item(list, 1, res); | |
883 | 883 | assert(MLError.success == res, `Failed to fetch item 1`); |
884 | 884 | |
885 | 885 | assert(startDate == item1.startDate, `READING to COMPLETE changed start date.`); |