CoolFace
Datasetpublic

FPEvalDataset/LeetCodeProblem

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes304downloads
main.ml51 linesDownload Raw Back to ocaml_tests
1 2module Main = struct3    open OUnit24 5    (* Program start *)6 7    (* Program end *)8 9    (* Test cases *)10    11let test1 _ = assert_equal 3 (addedInteger [2;6;4] [9;7;5])12 13let test2 _ = assert_equal (-5) (addedInteger [10] [5])14 15let test3 _ = assert_equal 0 (addedInteger [1;1;1;1] [1;1;1;1])16 17let test4 _ = assert_equal (-203) (addedInteger [900; 406; 917; 736; 331; 89; 81; 268; 776; 577; 299; 33; 555; 191; 54; 329; 85; 429; 623; 887; 533; 290; 806; 636; 946; 105] [697; 203; 714; 533; 128; ( -114); ( -122); 65; 573; 374; 96; ( -170); 352; ( -12); ( -149); 126; ( -118); 226; 420; 684; 330; 87; 603; 433; 743; ( -98)])18 19let test5 _ = assert_equal 571 (addedInteger [102; 64; 584; 874; 258; 453; 115; 505; 147; 784; 692; 257; 884; 872; 194; 380; 23; 268; 125; 419; 704; 749; 149; 458; 730; 731; 113; 649; 697; 895; 172; 384; 568; 414; 69; 407; 696; 501; 285; 478; 524; 198; 11; 942; 464; 816; 461; 869; 211] [673; 635; 1155; 1445; 829; 1024; 686; 1076; 718; 1355; 1263; 828; 1455; 1443; 765; 951; 594; 839; 696; 990; 1275; 1320; 720; 1029; 1301; 1302; 684; 1220; 1268; 1466; 743; 955; 1139; 985; 640; 978; 1267; 1072; 856; 1049; 1095; 769; 582; 1513; 1035; 1387; 1032; 1440; 782])20 21let test6 _ = assert_equal 581 (addedInteger [728; 220; 82] [1309; 801; 663])22 23let test7 _ = assert_equal 926 (addedInteger [382; 525; 20; 929; 409; 352; 407; 278; 120; 425; 299; 168; 262; 257; 274; 447; 147; 941; 307; 991; 380; 775; 384; 536; 143; 384; 600; 131; 870; 20; 937; 71; 809; 664; 524; 707; 930; 724; 730; 477; 326; 390; 310] [1308; 1451; 946; 1855; 1335; 1278; 1333; 1204; 1046; 1351; 1225; 1094; 1188; 1183; 1200; 1373; 1073; 1867; 1233; 1917; 1306; 1701; 1310; 1462; 1069; 1310; 1526; 1057; 1796; 946; 1863; 997; 1735; 1590; 1450; 1633; 1856; 1650; 1656; 1403; 1252; 1316; 1236])24 25let test8 _ = assert_equal 463 (addedInteger [106; 441; 732; 944; 345; 134; 985; 522; 51; 242; 685; 270; 710; 946; 769; 870; 910; 453; 753; 495; 794; 779; 553; 821; 359; 604; 964; 885; 919; 341; 454; 829; 473; 39; 135; 560; 189; 590; 584] [569; 904; 1195; 1407; 808; 597; 1448; 985; 514; 705; 1148; 733; 1173; 1409; 1232; 1333; 1373; 916; 1216; 958; 1257; 1242; 1016; 1284; 822; 1067; 1427; 1348; 1382; 804; 917; 1292; 936; 502; 598; 1023; 652; 1053; 1047])26 27let test9 _ = assert_equal 627 (addedInteger [181; 844; 69; 52; 815; 368; 150; 273; 872; 972; 198; 926; 818; 534; 488; 182; 708; 254; 89; 601; 769; 401; 340; 593; 28; 429; 25; 624; 594; 406; 479; 171; 556; 757; 988; 478; 763; 833; 795; 382; 374; 936; 572; 509; 169; 781; 745; 538; 905; 632; 868; 274; 758; 955; 468; 771; 192; 627; 77; 606; 971; 571; 409; 381; 932; 810; 508; 143; 735; 616; 233; 367; 396; 413; 119; 970; 96; 637; 325; 188; 421; 551; 547; 443; 570; 428] [808; 1471; 696; 679; 1442; 995; 777; 900; 1499; 1599; 825; 1553; 1445; 1161; 1115; 809; 1335; 881; 716; 1228; 1396; 1028; 967; 1220; 655; 1056; 652; 1251; 1221; 1033; 1106; 798; 1183; 1384; 1615; 1105; 1390; 1460; 1422; 1009; 1001; 1563; 1199; 1136; 796; 1408; 1372; 1165; 1532; 1259; 1495; 901; 1385; 1582; 1095; 1398; 819; 1254; 704; 1233; 1598; 1198; 1036; 1008; 1559; 1437; 1135; 770; 1362; 1243; 860; 994; 1023; 1040; 746; 1597; 723; 1264; 952; 815; 1048; 1178; 1174; 1070; 1197; 1055])28 29let test10 _ = assert_equal 691 (addedInteger [553; 442; 222; 424; 602; 283; 297; 580; 513; 175; 25; 6; 446; 346; 973; 353; 451; 151; 35; 948; 283; 303; 765; 559; 510; 354; 19; 951; 206; 363; 856; 407; 233; 127; 175; 393; 472; 189; 859; 355; 160; 78; 264; 853; 745; 134; 558; 521; 145; 80; 629; 425; 41; 620; 116; 265; 876; 686; 210; 27; 159; 397; 561; 530; 713; 24; 204; 67; 317; 197; 566; 555; 19; 324; 190; 745; 6; 165; 910; 289] [1244; 1133; 913; 1115; 1293; 974; 988; 1271; 1204; 866; 716; 697; 1137; 1037; 1664; 1044; 1142; 842; 726; 1639; 974; 994; 1456; 1250; 1201; 1045; 710; 1642; 897; 1054; 1547; 1098; 924; 818; 866; 1084; 1163; 880; 1550; 1046; 851; 769; 955; 1544; 1436; 825; 1249; 1212; 836; 771; 1320; 1116; 732; 1311; 807; 956; 1567; 1377; 901; 718; 850; 1088; 1252; 1221; 1404; 715; 895; 758; 1008; 888; 1257; 1246; 710; 1015; 881; 1436; 697; 856; 1601; 980])30 31 32    (* Grouping test cases *)33    let suite = "Test Suite for addedInteger" >::: [34        35  "test1" >:: test1;36  "test2" >:: test2;37  "test3" >:: test3;38  "test4" >:: test4;39  "test5" >:: test5;40  "test6" >:: test6;41  "test7" >:: test7;42  "test8" >:: test8;43  "test9" >:: test9;44  "test10" >:: test10;45    ]46 47 48    (* Running the tests *)49    let () = run_test_tt_main suite50end51