From c299517f7b320d37dce614dd0c47b26d8210beb1 Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 9 Apr 2024 15:55:51 +0200 Subject: [PATCH] Remove tightly coupled tests --- .gitignore | 1 + combined.coverage | 1 - tests/unit/test.ml | 7 ------- tests/unit/test_cases/query.ml | 19 ------------------- 4 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 combined.coverage delete mode 100644 tests/unit/test_cases/query.ml diff --git a/.gitignore b/.gitignore index 1f52283..e3b8520 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ _opam/ _build/ _coverage/ +*.coverage diff --git a/combined.coverage b/combined.coverage deleted file mode 100644 index f7711e4..0000000 --- a/combined.coverage +++ /dev/null @@ -1 +0,0 @@ -BISECT-COVERAGE-4 41 36 lib/api/community/community_event.ml 9 175 236 250 265 383 296 412 276 46 9 1 1 1 1 1 1 0 1 1 28 lib/models/stub/clan_info.ml 30 594 775 315 912 917 955 963 1009 1017 1069 1077 1115 1123 1161 1169 1221 1226 1320 1325 1265 1373 1381 1441 1449 1503 1508 1579 1590 1597 850 30 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 32 lib/models/stub/advertisement.ml 46 1101 538 1541 1546 1620 1625 1713 1718 1794 1802 1882 1887 1947 1952 2024 2032 2096 2101 2165 2173 2237 2245 2329 2334 2404 2409 2483 2488 2562 2573 2580 2675 2680 2752 2757 2831 2836 2912 2917 3005 3010 3082 3087 3173 3181 1492 46 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 46 lib/models/response/community/advertisement.ml 13 177 219 283 134 426 448 492 503 510 583 594 601 356 13 0 0 0 0 1 1 1 1 1 1 1 1 1 25 lib/api/community/clan.ml 28 35 48 70 84 97 213 290 356 421 409 497 534 557 572 679 603 708 583 123 871 932 960 975 1087 1006 1116 986 770 28 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 37 lib/models/stub/leaderboard_region.ml 8 83 255 260 298 306 358 363 193 8 0 8 8 8 8 8 8 8 23 lib/models/stub/news.ml 24 296 857 862 924 929 1003 1011 1103 1108 1206 1211 1301 1306 1374 1382 1448 1456 1522 1530 1602 1607 1677 1682 808 24 0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 44 lib/models/response/community/achievement.ml 9 151 201 108 351 373 434 445 452 281 9 0 0 0 1 1 1 1 1 1 29 lib/models/stub/stat_group.ml 12 223 107 346 351 389 397 436 441 485 496 503 284 12 0 0 24 24 24 24 24 24 24 24 24 24 37 lib/models/response/community/news.ml 9 128 162 89 289 311 349 360 367 219 9 0 0 0 1 1 2 1 1 2 27 lib/models/stub/response.ml 6 66 204 209 273 281 151 6 0 12 12 12 12 12 25 lib/api/community/news.ml 9 139 200 214 229 308 260 441 240 46 9 2 2 2 2 2 2 0 2 2 34 lib/api/community/advertisement.ml 13 35 48 187 264 293 323 340 355 471 386 500 366 74 13 1 1 1 1 1 1 1 1 1 1 0 1 1 17 lib/data/query.ml 12 70 55 41 23 171 156 142 124 274 259 245 227 12 8 6 6 6 3 1 1 1 6 2 2 2 16 lib/data/game.ml 4 68 85 102 119 4 0 14 0 0 13 lib/client.ml 21 99 191 248 276 338 400 352 576 678 619 603 708 430 302 202 148 812 826 867 917 768 21 12 3 3 3 2 2 2 1 1 1 1 1 1 2 3 3 11 3 14 14 14 31 lib/models/stub/match_member.ml 14 148 457 462 532 537 601 606 680 685 749 754 816 821 396 14 0 2 2 2 2 2 2 2 2 2 2 2 2 2 34 lib/models/stub/community_event.ml 26 365 944 949 987 995 1035 1040 1077 1082 1132 1137 1203 1208 1270 1275 1343 1348 1408 1413 1463 1471 1521 1526 1583 1591 882 26 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11 lib/json.ml 9 286 323 404 361 416 222 332 208 188 9 0 1 0 0 0 1 0 1 2 38 lib/models/stub/leaderboard_sorting.ml 7 144 76 98 116 59 209 229 7 0 0 0 0 0 0 2 30 lib/models/stub/leaderboard.ml 14 235 228 276 127 415 420 458 466 512 517 580 591 598 353 14 0 0 0 0 13 13 13 13 13 13 13 13 13 13 23 lib/models/stub/race.ml 10 106 318 323 361 369 419 424 476 481 256 10 0 45 45 45 45 45 45 45 45 45 44 lib/models/response/community/leaderboard.ml 21 405 452 529 599 670 362 817 839 919 930 937 1035 1046 1053 1139 1150 1157 1279 1290 1297 760 21 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 55 lib/models/response/community/achievement_attainment.ml 15 263 231 355 394 140 581 603 691 706 895 821 969 775 998 490 15 0 0 0 0 0 2 2 2 2 2 2 0 2 2 2 34 lib/models/stub/leaderboard_map.ml 8 98 322 327 385 390 434 439 240 8 0 25 25 25 25 25 25 25 32 lib/api/community/achievement.ml 22 173 234 248 263 377 294 406 274 56 458 691 758 802 829 844 981 881 1013 857 510 569 483 22 1 1 1 1 1 1 0 1 1 0 3 3 3 3 3 2 2 1 3 0 3 3 44 lib/models/response/community/avatar_stat.ml 9 159 215 116 392 414 496 507 514 303 9 0 0 0 1 1 1 1 1 1 35 lib/models/stub/clan_permissions.ml 40 316 309 367 360 416 409 465 458 514 507 565 558 618 611 683 676 241 854 859 897 902 951 956 1003 1008 1055 1060 1107 1112 1161 1166 1217 1222 1285 1290 1333 1341 1393 1398 788 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 30 lib/models/stub/avatar_stat.ml 10 115 383 388 444 449 489 494 546 551 305 10 0 1 1 1 1 1 1 1 1 1 41 lib/models/stub/achievement_attainment.ml 6 78 263 268 342 347 190 6 0 85 85 85 85 85 45 lib/models/response/community/leaderboard2.ml 15 219 264 345 176 538 560 611 622 629 718 729 736 817 822 468 15 0 0 0 0 2 2 2 2 2 2 2 2 2 2 2 35 lib/models/stub/leaderboard_stat.ml 36 381 1148 1153 1211 1216 1254 1259 1301 1306 1348 1353 1399 1404 1444 1449 1487 1492 1540 1545 1593 1598 1640 1645 1695 1700 1760 1765 1821 1826 1878 1883 1945 1950 2006 2011 1066 36 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 48 lib/models/response/community/community_event.ml 9 154 204 111 357 379 439 450 457 287 9 0 0 0 1 1 1 1 1 1 30 lib/models/stub/join_policy.ml 9 247 169 183 203 219 152 312 324 342 9 0 2 1 0 0 3 1 0 0 30 lib/models/stub/achievement.ml 18 207 608 613 671 679 761 766 862 867 925 933 1007 1012 1076 1081 1157 1162 559 18 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 32 lib/api/community/leaderboard.ml 41 163 224 238 253 367 284 396 264 46 455 696 763 808 835 850 976 887 1008 863 507 566 480 1072 1129 1162 1177 1192 1334 1411 1490 1448 1566 1612 1649 1672 1687 1802 1718 1831 1698 1226 41 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 0 2 2 25 lib/models/stub/avatar.ml 18 203 609 614 672 680 740 748 840 845 899 904 964 969 1059 1064 1128 1136 544 18 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 29 lib/models/stub/match_type.ml 8 83 255 260 298 306 358 363 193 8 0 25 25 25 25 25 25 25 23 lib/models/stub/clan.ml 26 730 451 958 963 1021 1029 1095 1103 1175 1183 1241 1249 1307 1315 1387 1392 1487 1492 1432 1559 1567 1647 1655 1729 1734 909 26 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 37 lib/models/response/community/clan.ml 9 129 164 90 292 314 354 365 372 222 9 0 0 0 1 1 1 1 1 1 42 lib/models/response/community/clan_info.ml 8 126 167 87 272 294 332 355 202 8 0 0 0 1 1 1 1 1 \ No newline at end of file diff --git a/tests/unit/test.ml b/tests/unit/test.ml index e79b7b4..3f86386 100644 --- a/tests/unit/test.ml +++ b/tests/unit/test.ml @@ -23,12 +23,5 @@ let () = Test_cases.Api.test_get_leaderboard2 ()) ; Alcotest_lwt.test_case "invalid json" `Quick (fun _ () -> Test_cases.Api.test_invalid ()) ] ) - ; ( "query" - , [ Alcotest_lwt.test_case "encode list" `Quick (fun _ () -> Test_cases.Query.test_encode_list_int ()) - ; Alcotest_lwt.test_case "encode list" `Quick (fun _ () -> - Test_cases.Query.test_encode_list_float ()) - ; Alcotest_lwt.test_case "encode list" `Quick (fun _ () -> - Test_cases.Query.test_encode_list_string ()) - ] ) ] ;; diff --git a/tests/unit/test_cases/query.ml b/tests/unit/test_cases/query.ml deleted file mode 100644 index 3fb9ff4..0000000 --- a/tests/unit/test_cases/query.ml +++ /dev/null @@ -1,19 +0,0 @@ -open Relic_sdk - -let test_encode_list_int () = - let lst = [ 1; 5; 7 ] in - let encoded = Data.Query.encode_lst_i lst in - Lwt.return @@ Alcotest.(check string) "List was encoded" "[1,5,7]" encoded -;; - -let test_encode_list_float () = - let lst = [ 1.2; 5.3; 7.7 ] in - let encoded = Data.Query.encode_lst_f lst in - Lwt.return @@ Alcotest.(check string) "List was encoded" "[1.2,5.3,7.7]" encoded -;; - -let test_encode_list_string () = - let lst = [ "item1"; "item2"; "item3"; "&"; "?" ] in - let encoded = Data.Query.encode_lst_s lst in - Lwt.return @@ Alcotest.(check string) "List was encoded" "[\"item1\",\"item2\",\"item3\",\"&\",\"?\"]" encoded -;;