From 6958f82a3d94ac6e87f4d58025263f963cac4a04 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 12 Jun 2022 10:00:11 -0500 Subject: [PATCH] Update: Add unit tests for is_punctuation in f_utf project. This includes minor style clean ups. --- level_0/f_utf/data/build/settings-tests | 3 +- .../data/tests/bytesequences/punctuation-all.txt | 819 +++++++++++++++++++++ .../data/tests/codepoints/punctuation-all.txt | 819 +++++++++++++++++++++ level_0/f_utf/tests/unit/c/data-utf.c | 13 +- level_0/f_utf/tests/unit/c/data-utf.h | 27 +- .../tests/unit/c/test-utf-character_is_private.c | 1 - .../unit/c/test-utf-character_is_punctuation.c | 39 + .../unit/c/test-utf-character_is_punctuation.h | 20 + .../tests/unit/c/test-utf-character_is_symbol.c | 1 - level_0/f_utf/tests/unit/c/test-utf-is_private.c | 1 - .../f_utf/tests/unit/c/test-utf-is_punctuation.c | 56 ++ .../f_utf/tests/unit/c/test-utf-is_punctuation.h | 20 + level_0/f_utf/tests/unit/c/test-utf-is_symbol.c | 1 - level_0/f_utf/tests/unit/c/test-utf.c | 2 + level_0/f_utf/tests/unit/c/test-utf.h | 2 + 15 files changed, 1809 insertions(+), 15 deletions(-) create mode 100644 level_0/f_utf/data/tests/bytesequences/punctuation-all.txt create mode 100644 level_0/f_utf/data/tests/codepoints/punctuation-all.txt create mode 100644 level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.c create mode 100644 level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.h create mode 100644 level_0/f_utf/tests/unit/c/test-utf-is_punctuation.c create mode 100644 level_0/f_utf/tests/unit/c/test-utf-is_punctuation.h diff --git a/level_0/f_utf/data/build/settings-tests b/level_0/f_utf/data/build/settings-tests index bfba7a6..196e3cb 100644 --- a/level_0/f_utf/data/build/settings-tests +++ b/level_0/f_utf/data/build/settings-tests @@ -26,8 +26,9 @@ build_libraries -lc -lcmocka build_libraries-individual -lf_memory -lf_string -lf_utf build_sources_program test-utf-append.c test-utf-append_assure.c test-utf-append_assure_nulless.c test-utf-append_nulless.c -build_sources_program test-utf-character_is_symbol.c test-utf-is_symbol.c build_sources_program test-utf-character_is_private.c test-utf-is_private.c +build_sources_program test-utf-character_is_punctuation.c test-utf-is_punctuation.c +build_sources_program test-utf-character_is_symbol.c test-utf-is_symbol.c build_sources_program test-utf-dynamic_adjust.c test-utf-dynamic_append.c test-utf-dynamic_append_assure.c test-utf-dynamic_append_assure_nulless.c test-utf-dynamic_append_nulless.c build_sources_program test-utf-dynamic_decimate_by.c test-utf-dynamic_decrease_by.c test-utf-dynamic_increase.c test-utf-dynamic_increase_by.c build_sources_program test-utf-dynamic_mash.c test-utf-dynamic_mash_nulless.c diff --git a/level_0/f_utf/data/tests/bytesequences/punctuation-all.txt b/level_0/f_utf/data/tests/bytesequences/punctuation-all.txt new file mode 100644 index 0000000..c6d4d5a --- /dev/null +++ b/level_0/f_utf/data/tests/bytesequences/punctuation-all.txt @@ -0,0 +1,819 @@ +33 +34 +35 +37 +38 +39 +40 +41 +42 +44 +45 +46 +47 +58 +59 +63 +64 +91 +92 +93 +95 +123 +125 +49825 +49831 +49835 +49846 +49847 +49851 +49855 +52670 +52871 +54682 +54683 +54684 +54685 +54686 +54687 +54921 +54922 +54974 +55168 +55171 +55174 +55219 +55220 +55433 +55434 +55436 +55437 +55451 +55453 +55454 +55455 +55722 +55723 +55724 +55725 +56212 +56448 +56449 +56450 +56451 +56452 +56453 +56454 +56455 +56456 +56457 +56458 +56459 +56460 +56461 +57271 +57272 +57273 +14721200 +14721201 +14721202 +14721203 +14721204 +14721205 +14721206 +14721207 +14721208 +14721209 +14721210 +14721211 +14721212 +14721213 +14721214 +14721438 +14722468 +14722469 +14722480 +14723005 +14723510 +14724016 +14725559 +14725764 +14727092 +14727567 +14727578 +14727579 +14728324 +14728325 +14728326 +14728327 +14728328 +14728329 +14728330 +14728331 +14728332 +14728333 +14728334 +14728335 +14728336 +14728337 +14728338 +14728340 +14728378 +14728379 +14728380 +14728381 +14728837 +14729104 +14729105 +14729106 +14729107 +14729108 +14729113 +14729114 +4036002944 +4036002945 +4036002946 +4036005535 +4036005776 +14778762 +14778763 +14778764 +14778765 +14778766 +14778767 +4036007343 +4036010391 +4036011167 +4036011199 +4036012432 +4036012433 +4036012434 +4036012435 +4036012436 +4036012437 +4036012438 +4036012439 +4036012440 +4036012479 +4036012976 +4036012977 +4036012978 +4036012979 +4036012980 +4036012981 +4036012982 +4036013241 +4036013242 +4036013243 +4036013244 +4036013245 +4036013246 +4036013247 +4036013721 +4036013722 +4036013723 +4036013724 +4036016813 +4036017557 +4036017558 +4036017559 +4036017560 +4036017561 +4036017798 +4036017799 +4036017800 +4036017801 +14779323 +4036067719 +4036067720 +4036067721 +4036067722 +4036067723 +4036067724 +4036067725 +4036068027 +4036068028 +4036068030 +4036068031 +4036068224 +4036068225 +4036068736 +4036068737 +4036068738 +4036068739 +4036068788 +4036068789 +4036069253 +4036069254 +4036069255 +4036069256 +4036069261 +4036069275 +4036069277 +4036069278 +4036069279 +4036069560 +4036069561 +4036069562 +4036069563 +4036069564 +4036069565 +4036070057 +4036071819 +4036071820 +4036071821 +4036071822 +4036071823 +4036071834 +4036071835 +4036071837 +4036072326 +4036073345 +4036073346 +4036073347 +4036073348 +4036073349 +4036073350 +4036073351 +4036073352 +4036073353 +4036073354 +4036073355 +4036073356 +4036073357 +4036073358 +4036073359 +4036073360 +4036073361 +4036073362 +4036073363 +4036073364 +4036073365 +4036073366 +4036073367 +4036073857 +4036073858 +4036073859 +4036073888 +4036073889 +4036073890 +4036073891 +4036073892 +4036073893 +4036073894 +4036073895 +4036073896 +4036073897 +4036073898 +4036073899 +4036073900 +4036074169 +4036074684 +4036074685 +4036074686 +4036075707 +4036076932 +4036076933 +4036076934 +4036077474 +4036077759 +4036077952 +4036077953 +4036077954 +4036077955 +4036077956 +4036077957 +4036077958 +4036078234 +4036078235 +4036078236 +4036078238 +4036078239 +4036078240 +4036078241 +4036078242 +4036080001 +4036080002 +4036080003 +4036080004 +4036080005 +4036080048 +4036080049 +4036082615 +4036082616 +4036083647 +4036137392 +4036137393 +4036137394 +4036137395 +4036137396 +4036149169 +4036149170 +14781856 +14781857 +14781858 +14781859 +14781860 +14781861 +14781862 +14781863 +14781864 +14782592 +14784942 +14785179 +14785180 +4036405678 +4036405679 +4036406197 +4036406455 +4036406456 +4036406457 +4036406458 +4036406459 +4036406660 +4036410007 +4036410008 +4036410009 +4036410010 +14785451 +14785452 +14785453 +4036411298 +14785717 +14785718 +14786452 +14786453 +14786454 +14786456 +14786457 +14786458 +14786688 +14786689 +14786690 +14786691 +14786692 +14786693 +14786694 +14786695 +14786696 +14786697 +14786698 +14787972 +14787973 +14788766 +14788767 +14789280 +14789281 +14789282 +14789283 +14789284 +14789285 +14789286 +14789288 +14789289 +14789290 +14789291 +14789292 +14789293 +14790042 +14790043 +14790044 +14790045 +14790046 +14790047 +14790048 +14790077 +14790078 +4036735647 +14790588 +14790589 +14790590 +14790591 +14790843 +14790844 +14790845 +14790846 +14790847 +14791102 +14791103 +14791552 +14791553 +14791554 +14791555 +14791556 +14791557 +14791558 +14791559 +14791571 +4036864647 +4036864648 +4036864649 +4036864650 +4036864651 +4036928926 +4036928927 +14844048 +14844049 +14844050 +14844051 +14844052 +14844053 +14844054 +14844055 +14844056 +14844057 +14844058 +14844059 +14844060 +14844061 +14844062 +14844063 +14844064 +14844065 +14844066 +14844067 +14844068 +14844069 +14844070 +14844071 +14844080 +14844081 +14844082 +14844083 +14844084 +14844085 +14844086 +14844087 +14844088 +14844089 +14844090 +14844091 +14844092 +14844093 +14844094 +14844095 +14844288 +14844289 +14844290 +14844291 +14844293 +14844294 +14844295 +14844296 +14844297 +14844298 +14844299 +14844300 +14844301 +14844302 +14844303 +14844304 +14844305 +14844307 +14844308 +14844309 +14844310 +14844311 +14844312 +14844313 +14844314 +14844315 +14844316 +14844317 +14844318 +14844349 +14844350 +14844557 +14844558 +14847112 +14847113 +14847114 +14847115 +14847145 +14847146 +14851496 +14851497 +14851498 +14851499 +14851500 +14851501 +14851502 +14851503 +14851504 +14851505 +14851506 +14851507 +14851508 +14851509 +14851973 +14851974 +14852006 +14852007 +14852008 +14852009 +14852010 +14852011 +14852012 +14852013 +14852014 +14852015 +14853763 +14853764 +14853765 +14853766 +14853767 +14853768 +14853769 +14853770 +14853771 +14853772 +14853773 +14853774 +14853775 +14853776 +14853777 +14853778 +14853779 +14853780 +14853781 +14853782 +14853783 +14853784 +14854040 +14854041 +14854042 +14854043 +14854076 +14854077 +14857145 +14857146 +14857147 +14857148 +14857150 +14857151 +14857648 +14858368 +14858369 +14858370 +14858371 +14858372 +14858373 +14858374 +14858375 +14858376 +14858377 +14858378 +14858379 +14858380 +14858381 +14858382 +14858383 +14858384 +14858385 +14858386 +14858387 +14858388 +14858389 +14858390 +14858391 +14858392 +14858393 +14858394 +14858395 +14858396 +14858397 +14858398 +14858399 +14858400 +14858401 +14858402 +14858403 +14858404 +14858405 +14858406 +14858407 +14858408 +14858409 +14858410 +14858411 +14858412 +14858413 +14858414 +14858416 +14858417 +14858418 +14858419 +14858420 +14858421 +14858422 +14858423 +14858424 +14858425 +14858426 +14858427 +14858428 +14858429 +14858430 +14858431 +14858624 +14858625 +14858626 +14858627 +14858628 +14858629 +14858630 +14858631 +14858632 +14858633 +14858634 +14858635 +14858636 +14858637 +14858638 +14858639 +14858642 +14858643 +14858644 +14858645 +14858646 +14858647 +14858648 +14858649 +14858650 +14858651 +14858652 +14858653 +14909569 +14909570 +14909571 +14909576 +14909577 +14909578 +14909579 +14909580 +14909581 +14909582 +14909583 +14909584 +14909585 +14909588 +14909589 +14909590 +14909591 +14909592 +14909593 +14909594 +14909595 +14909596 +14909597 +14909598 +14909599 +14909616 +14909629 +14910112 +14910395 +15373246 +15373247 +15374477 +15374478 +15374479 +15374771 +15374782 +15375282 +15375283 +15375284 +15375285 +15375286 +15375287 +15376820 +15376821 +15376822 +15376823 +15377294 +15377295 +15377336 +15377337 +15377338 +15377340 +15377582 +15377583 +15377823 +15378305 +15378306 +15378307 +15378308 +15378309 +15378310 +15378311 +15378312 +15378313 +15378314 +15378315 +15378316 +15378317 +15378334 +15378335 +15378844 +15378845 +15378846 +15378847 +15379358 +15379359 +15379376 +15379377 +15380395 +15709374 +15709375 +15710352 +15710353 +15710354 +15710355 +15710356 +15710357 +15710358 +15710359 +15710360 +15710361 +15710384 +15710385 +15710386 +15710387 +15710388 +15710389 +15710390 +15710391 +15710392 +15710393 +15710394 +15710395 +15710396 +15710397 +15710398 +15710399 +15710592 +15710593 +15710594 +15710595 +15710596 +15710597 +15710598 +15710599 +15710600 +15710601 +15710602 +15710603 +15710604 +15710605 +15710606 +15710607 +15710608 +15710609 +15710610 +15710612 +15710613 +15710614 +15710615 +15710616 +15710617 +15710618 +15710619 +15710620 +15710621 +15710622 +15710623 +15710624 +15710625 +15710627 +15710632 +15710634 +15710635 +15711361 +15711362 +15711363 +15711365 +15711366 +15711367 +15711368 +15711369 +15711370 +15711372 +15711373 +15711374 +15711375 +15711386 +15711387 +15711391 +15711392 +15711419 +15711420 +15711421 +15711423 +15711643 +15711645 +15711647 +15711648 +15711649 +15711650 +15711651 +15711652 +15711653 diff --git a/level_0/f_utf/data/tests/codepoints/punctuation-all.txt b/level_0/f_utf/data/tests/codepoints/punctuation-all.txt new file mode 100644 index 0000000..6440757 --- /dev/null +++ b/level_0/f_utf/data/tests/codepoints/punctuation-all.txt @@ -0,0 +1,819 @@ +U+0021 +U+0022 +U+0023 +U+0025 +U+0026 +U+0027 +U+0028 +U+0029 +U+002A +U+002C +U+002D +U+002E +U+002F +U+003A +U+003B +U+003F +U+0040 +U+005B +U+005C +U+005D +U+005F +U+007B +U+007D +U+00A1 +U+00A7 +U+00AB +U+00B6 +U+00B7 +U+00BB +U+00BF +U+037E +U+0387 +U+055A +U+055B +U+055C +U+055D +U+055E +U+055F +U+0589 +U+058A +U+05BE +U+05C0 +U+05C3 +U+05C6 +U+05F3 +U+05F4 +U+0609 +U+060A +U+060C +U+060D +U+061B +U+061D +U+061E +U+061F +U+066A +U+066B +U+066C +U+066D +U+06D4 +U+0700 +U+0701 +U+0702 +U+0703 +U+0704 +U+0705 +U+0706 +U+0707 +U+0708 +U+0709 +U+070A +U+070B +U+070C +U+070D +U+07F7 +U+07F8 +U+07F9 +U+0830 +U+0831 +U+0832 +U+0833 +U+0834 +U+0835 +U+0836 +U+0837 +U+0838 +U+0839 +U+083A +U+083B +U+083C +U+083D +U+083E +U+085E +U+0964 +U+0965 +U+0970 +U+09FD +U+0A76 +U+0AF0 +U+0C77 +U+0C84 +U+0DF4 +U+0E4F +U+0E5A +U+0E5B +U+0F04 +U+0F05 +U+0F06 +U+0F07 +U+0F08 +U+0F09 +U+0F0A +U+0F0B +U+0F0C +U+0F0D +U+0F0E +U+0F0F +U+0F10 +U+0F11 +U+0F12 +U+0F14 +U+0F3A +U+0F3B +U+0F3C +U+0F3D +U+0F85 +U+0FD0 +U+0FD1 +U+0FD2 +U+0FD3 +U+0FD4 +U+0FD9 +U+0FDA +U+10100 +U+10101 +U+10102 +U+1039F +U+103D0 +U+104A +U+104B +U+104C +U+104D +U+104E +U+104F +U+1056F +U+10857 +U+1091F +U+1093F +U+10A50 +U+10A51 +U+10A52 +U+10A53 +U+10A54 +U+10A55 +U+10A56 +U+10A57 +U+10A58 +U+10A7F +U+10AF0 +U+10AF1 +U+10AF2 +U+10AF3 +U+10AF4 +U+10AF5 +U+10AF6 +U+10B39 +U+10B3A +U+10B3B +U+10B3C +U+10B3D +U+10B3E +U+10B3F +U+10B99 +U+10B9A +U+10B9B +U+10B9C +U+10EAD +U+10F55 +U+10F56 +U+10F57 +U+10F58 +U+10F59 +U+10F86 +U+10F87 +U+10F88 +U+10F89 +U+10FB +U+11047 +U+11048 +U+11049 +U+1104A +U+1104B +U+1104C +U+1104D +U+110BB +U+110BC +U+110BE +U+110BF +U+110C0 +U+110C1 +U+11140 +U+11141 +U+11142 +U+11143 +U+11174 +U+11175 +U+111C5 +U+111C6 +U+111C7 +U+111C8 +U+111CD +U+111DB +U+111DD +U+111DE +U+111DF +U+11238 +U+11239 +U+1123A +U+1123B +U+1123C +U+1123D +U+112A9 +U+1144B +U+1144C +U+1144D +U+1144E +U+1144F +U+1145A +U+1145B +U+1145D +U+114C6 +U+115C1 +U+115C2 +U+115C3 +U+115C4 +U+115C5 +U+115C6 +U+115C7 +U+115C8 +U+115C9 +U+115CA +U+115CB +U+115CC +U+115CD +U+115CE +U+115CF +U+115D0 +U+115D1 +U+115D2 +U+115D3 +U+115D4 +U+115D5 +U+115D6 +U+115D7 +U+11641 +U+11642 +U+11643 +U+11660 +U+11661 +U+11662 +U+11663 +U+11664 +U+11665 +U+11666 +U+11667 +U+11668 +U+11669 +U+1166A +U+1166B +U+1166C +U+116B9 +U+1173C +U+1173D +U+1173E +U+1183B +U+11944 +U+11945 +U+11946 +U+119E2 +U+11A3F +U+11A40 +U+11A41 +U+11A42 +U+11A43 +U+11A44 +U+11A45 +U+11A46 +U+11A9A +U+11A9B +U+11A9C +U+11A9E +U+11A9F +U+11AA0 +U+11AA1 +U+11AA2 +U+11C41 +U+11C42 +U+11C43 +U+11C44 +U+11C45 +U+11C70 +U+11C71 +U+11EF7 +U+11EF8 +U+11FFF +U+12470 +U+12471 +U+12472 +U+12473 +U+12474 +U+12FF1 +U+12FF2 +U+1360 +U+1361 +U+1362 +U+1363 +U+1364 +U+1365 +U+1366 +U+1367 +U+1368 +U+1400 +U+166E +U+169B +U+169C +U+16A6E +U+16A6F +U+16AF5 +U+16B37 +U+16B38 +U+16B39 +U+16B3A +U+16B3B +U+16B44 +U+16E97 +U+16E98 +U+16E99 +U+16E9A +U+16EB +U+16EC +U+16ED +U+16FE2 +U+1735 +U+1736 +U+17D4 +U+17D5 +U+17D6 +U+17D8 +U+17D9 +U+17DA +U+1800 +U+1801 +U+1802 +U+1803 +U+1804 +U+1805 +U+1806 +U+1807 +U+1808 +U+1809 +U+180A +U+1944 +U+1945 +U+1A1E +U+1A1F +U+1AA0 +U+1AA1 +U+1AA2 +U+1AA3 +U+1AA4 +U+1AA5 +U+1AA6 +U+1AA8 +U+1AA9 +U+1AAA +U+1AAB +U+1AAC +U+1AAD +U+1B5A +U+1B5B +U+1B5C +U+1B5D +U+1B5E +U+1B5F +U+1B60 +U+1B7D +U+1B7E +U+1BC9F +U+1BFC +U+1BFD +U+1BFE +U+1BFF +U+1C3B +U+1C3C +U+1C3D +U+1C3E +U+1C3F +U+1C7E +U+1C7F +U+1CC0 +U+1CC1 +U+1CC2 +U+1CC3 +U+1CC4 +U+1CC5 +U+1CC6 +U+1CC7 +U+1CD3 +U+1DA87 +U+1DA88 +U+1DA89 +U+1DA8A +U+1DA8B +U+1E95E +U+1E95F +U+2010 +U+2011 +U+2012 +U+2013 +U+2014 +U+2015 +U+2016 +U+2017 +U+2018 +U+2019 +U+201A +U+201B +U+201C +U+201D +U+201E +U+201F +U+2020 +U+2021 +U+2022 +U+2023 +U+2024 +U+2025 +U+2026 +U+2027 +U+2030 +U+2031 +U+2032 +U+2033 +U+2034 +U+2035 +U+2036 +U+2037 +U+2038 +U+2039 +U+203A +U+203B +U+203C +U+203D +U+203E +U+203F +U+2040 +U+2041 +U+2042 +U+2043 +U+2045 +U+2046 +U+2047 +U+2048 +U+2049 +U+204A +U+204B +U+204C +U+204D +U+204E +U+204F +U+2050 +U+2051 +U+2053 +U+2054 +U+2055 +U+2056 +U+2057 +U+2058 +U+2059 +U+205A +U+205B +U+205C +U+205D +U+205E +U+207D +U+207E +U+208D +U+208E +U+2308 +U+2309 +U+230A +U+230B +U+2329 +U+232A +U+2768 +U+2769 +U+276A +U+276B +U+276C +U+276D +U+276E +U+276F +U+2770 +U+2771 +U+2772 +U+2773 +U+2774 +U+2775 +U+27C5 +U+27C6 +U+27E6 +U+27E7 +U+27E8 +U+27E9 +U+27EA +U+27EB +U+27EC +U+27ED +U+27EE +U+27EF +U+2983 +U+2984 +U+2985 +U+2986 +U+2987 +U+2988 +U+2989 +U+298A +U+298B +U+298C +U+298D +U+298E +U+298F +U+2990 +U+2991 +U+2992 +U+2993 +U+2994 +U+2995 +U+2996 +U+2997 +U+2998 +U+29D8 +U+29D9 +U+29DA +U+29DB +U+29FC +U+29FD +U+2CF9 +U+2CFA +U+2CFB +U+2CFC +U+2CFE +U+2CFF +U+2D70 +U+2E00 +U+2E01 +U+2E02 +U+2E03 +U+2E04 +U+2E05 +U+2E06 +U+2E07 +U+2E08 +U+2E09 +U+2E0A +U+2E0B +U+2E0C +U+2E0D +U+2E0E +U+2E0F +U+2E10 +U+2E11 +U+2E12 +U+2E13 +U+2E14 +U+2E15 +U+2E16 +U+2E17 +U+2E18 +U+2E19 +U+2E1A +U+2E1B +U+2E1C +U+2E1D +U+2E1E +U+2E1F +U+2E20 +U+2E21 +U+2E22 +U+2E23 +U+2E24 +U+2E25 +U+2E26 +U+2E27 +U+2E28 +U+2E29 +U+2E2A +U+2E2B +U+2E2C +U+2E2D +U+2E2E +U+2E30 +U+2E31 +U+2E32 +U+2E33 +U+2E34 +U+2E35 +U+2E36 +U+2E37 +U+2E38 +U+2E39 +U+2E3A +U+2E3B +U+2E3C +U+2E3D +U+2E3E +U+2E3F +U+2E40 +U+2E41 +U+2E42 +U+2E43 +U+2E44 +U+2E45 +U+2E46 +U+2E47 +U+2E48 +U+2E49 +U+2E4A +U+2E4B +U+2E4C +U+2E4D +U+2E4E +U+2E4F +U+2E52 +U+2E53 +U+2E54 +U+2E55 +U+2E56 +U+2E57 +U+2E58 +U+2E59 +U+2E5A +U+2E5B +U+2E5C +U+2E5D +U+3001 +U+3002 +U+3003 +U+3008 +U+3009 +U+300A +U+300B +U+300C +U+300D +U+300E +U+300F +U+3010 +U+3011 +U+3014 +U+3015 +U+3016 +U+3017 +U+3018 +U+3019 +U+301A +U+301B +U+301C +U+301D +U+301E +U+301F +U+3030 +U+303D +U+30A0 +U+30FB +U+A4FE +U+A4FF +U+A60D +U+A60E +U+A60F +U+A673 +U+A67E +U+A6F2 +U+A6F3 +U+A6F4 +U+A6F5 +U+A6F6 +U+A6F7 +U+A874 +U+A875 +U+A876 +U+A877 +U+A8CE +U+A8CF +U+A8F8 +U+A8F9 +U+A8FA +U+A8FC +U+A92E +U+A92F +U+A95F +U+A9C1 +U+A9C2 +U+A9C3 +U+A9C4 +U+A9C5 +U+A9C6 +U+A9C7 +U+A9C8 +U+A9C9 +U+A9CA +U+A9CB +U+A9CC +U+A9CD +U+A9DE +U+A9DF +U+AA5C +U+AA5D +U+AA5E +U+AA5F +U+AADE +U+AADF +U+AAF0 +U+AAF1 +U+ABEB +U+FD3E +U+FD3F +U+FE10 +U+FE11 +U+FE12 +U+FE13 +U+FE14 +U+FE15 +U+FE16 +U+FE17 +U+FE18 +U+FE19 +U+FE30 +U+FE31 +U+FE32 +U+FE33 +U+FE34 +U+FE35 +U+FE36 +U+FE37 +U+FE38 +U+FE39 +U+FE3A +U+FE3B +U+FE3C +U+FE3D +U+FE3E +U+FE3F +U+FE40 +U+FE41 +U+FE42 +U+FE43 +U+FE44 +U+FE45 +U+FE46 +U+FE47 +U+FE48 +U+FE49 +U+FE4A +U+FE4B +U+FE4C +U+FE4D +U+FE4E +U+FE4F +U+FE50 +U+FE51 +U+FE52 +U+FE54 +U+FE55 +U+FE56 +U+FE57 +U+FE58 +U+FE59 +U+FE5A +U+FE5B +U+FE5C +U+FE5D +U+FE5E +U+FE5F +U+FE60 +U+FE61 +U+FE63 +U+FE68 +U+FE6A +U+FE6B +U+FF01 +U+FF02 +U+FF03 +U+FF05 +U+FF06 +U+FF07 +U+FF08 +U+FF09 +U+FF0A +U+FF0C +U+FF0D +U+FF0E +U+FF0F +U+FF1A +U+FF1B +U+FF1F +U+FF20 +U+FF3B +U+FF3C +U+FF3D +U+FF3F +U+FF5B +U+FF5D +U+FF5F +U+FF60 +U+FF61 +U+FF62 +U+FF63 +U+FF64 +U+FF65 diff --git a/level_0/f_utf/tests/unit/c/data-utf.c b/level_0/f_utf/tests/unit/c/data-utf.c index fdcef4c..51b215d 100644 --- a/level_0/f_utf/tests/unit/c/data-utf.c +++ b/level_0/f_utf/tests/unit/c/data-utf.c @@ -4,14 +4,19 @@ extern "C" { #endif -FILE *data__bytesequence_file_open__symbols(void) { +FILE *data__bytesequence_file_open__private(void) { - return fopen("./data/tests/bytesequences/symbols-all.txt", "r"); + return fopen("./data/tests/bytesequences/private-all.txt", "r"); } -FILE *data__bytesequence_file_open__private(void) { +FILE *data__bytesequence_file_open__punctuation(void) { - return fopen("./data/tests/bytesequences/private-all.txt", "r"); + return fopen("./data/tests/bytesequences/punctuation-all.txt", "r"); +} + +FILE *data__bytesequence_file_open__symbols(void) { + + return fopen("./data/tests/bytesequences/symbols-all.txt", "r"); } uint8_t data__bytesequence_get_line(FILE * const file, f_utf_char_t * const character) { diff --git a/level_0/f_utf/tests/unit/c/data-utf.h b/level_0/f_utf/tests/unit/c/data-utf.h index 3f7d05c..411ef93 100644 --- a/level_0/f_utf/tests/unit/c/data-utf.h +++ b/level_0/f_utf/tests/unit/c/data-utf.h @@ -23,11 +23,11 @@ extern "C" { #endif /** - * Open the "symbols" bytesequence file. + * Open the "private use area" bytesequence file. * * This assumes the following: * - The file path is relative to the current working directory (tests are run from project root). - * - The file path is "data/tests/bytesequences/symbols-all.txt". + * - The file path is "data/tests/bytesequences/private-all.txt". * * @return * Non-zero on success. @@ -35,14 +35,14 @@ extern "C" { * * @see fopen() */ -extern FILE *data__bytesequence_file_open__symbols(void); +extern FILE *data__bytesequence_file_open__private(void); /** - * Open the "private use area" bytesequence file. + * Open the "punctuation" bytesequence file. * * This assumes the following: * - The file path is relative to the current working directory (tests are run from project root). - * - The file path is "data/tests/bytesequences/private-all.txt". + * - The file path is "data/tests/bytesequences/punctuation-all.txt". * * @return * Non-zero on success. @@ -50,7 +50,22 @@ extern FILE *data__bytesequence_file_open__symbols(void); * * @see fopen() */ -extern FILE *data__bytesequence_file_open__private(void); +extern FILE *data__bytesequence_file_open__punctuation(void); + +/** + * Open the "symbols" bytesequence file. + * + * This assumes the following: + * - The file path is relative to the current working directory (tests are run from project root). + * - The file path is "data/tests/bytesequences/symbols-all.txt". + * + * @return + * Non-zero on success. + * 0 on failure. + * + * @see fopen() + */ +extern FILE *data__bytesequence_file_open__symbols(void); /** * Simple line reader that converts the line into a character. diff --git a/level_0/f_utf/tests/unit/c/test-utf-character_is_private.c b/level_0/f_utf/tests/unit/c/test-utf-character_is_private.c index 85dbf56..bf176cc 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-character_is_private.c +++ b/level_0/f_utf/tests/unit/c/test-utf-character_is_private.c @@ -32,7 +32,6 @@ void test__f_utf_character_is_private__works(void **state) { fclose(file); } - } #ifdef __cplusplus diff --git a/level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.c b/level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.c new file mode 100644 index 0000000..b0bea4c --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.c @@ -0,0 +1,39 @@ +#include "test-utf.h" +#include "test-utf-character_is_punctuation.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_character_is_punctuation__works(void **state) { + + { + FILE *file = data__bytesequence_file_open__punctuation(); + + assert_non_null(file); + + f_utf_char_t character = 0; + int8_t bytes = 0; + + f_array_length_t line = 0; + + do { + bytes = data__bytesequence_get_line(file, &character); + + if (bytes) { + const f_status_t status = f_utf_character_is_punctuation(character); + + assert_true(status); + } + + ++line; + + } while (bytes > 0); + + fclose(file); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.h b/level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.h new file mode 100644 index 0000000..c78ec19 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-character_is_punctuation.h @@ -0,0 +1,20 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.5 + * Licenses: lgpl-2.1-or-later + * + * Test the function in the utf project. + */ +#ifndef _TEST__F_utf_character_is_punctuation_h +#define _TEST__F_utf_character_is_punctuation_h + +/** + * Test that the function works. + * + * @see f_utf_character_is_punctuation() + */ +extern void test__f_utf_character_is_punctuation__works(void **state); + +#endif // _TEST__F_utf_character_is_punctuation_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-character_is_symbol.c b/level_0/f_utf/tests/unit/c/test-utf-character_is_symbol.c index ea19cd8..75db136 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-character_is_symbol.c +++ b/level_0/f_utf/tests/unit/c/test-utf-character_is_symbol.c @@ -32,7 +32,6 @@ void test__f_utf_character_is_symbol__works(void **state) { fclose(file); } - } #ifdef __cplusplus diff --git a/level_0/f_utf/tests/unit/c/test-utf-is_private.c b/level_0/f_utf/tests/unit/c/test-utf-is_private.c index c0c9999..9c0d07f 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-is_private.c +++ b/level_0/f_utf/tests/unit/c/test-utf-is_private.c @@ -49,7 +49,6 @@ void test__f_utf_is_private__works(void **state) { fclose(file); } - } #ifdef __cplusplus diff --git a/level_0/f_utf/tests/unit/c/test-utf-is_punctuation.c b/level_0/f_utf/tests/unit/c/test-utf-is_punctuation.c new file mode 100644 index 0000000..f407498 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-is_punctuation.c @@ -0,0 +1,56 @@ +#include "test-utf.h" +#include "test-utf-is_punctuation.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_utf_is_punctuation__works(void **state) { + + { + FILE *file = data__bytesequence_file_open__punctuation(); + + assert_non_null(file); + + f_utf_char_t character = 0; + int8_t bytes = 0; + + f_array_length_t line = 0; + + do { + bytes = data__bytesequence_get_line(file, &character); + + if (bytes) { + const uint8_t width = macro_f_utf_char_t_width(character); + char buffer[5] = { 0, 0, 0, 0, 0 }; + + buffer[0] = macro_f_utf_char_t_to_char_1(character); + + if (width > 1) { + buffer[1] = macro_f_utf_char_t_to_char_2(character); + + if (width > 2) { + buffer[2] = macro_f_utf_char_t_to_char_3(character); + + if (width > 3) { + buffer[3] = macro_f_utf_char_t_to_char_4(character); + } + } + } + + const f_status_t status = f_utf_is_punctuation(buffer, 5); + + assert_true(status); + } + + ++line; + + } while (bytes > 0); + + fclose(file); + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_utf/tests/unit/c/test-utf-is_punctuation.h b/level_0/f_utf/tests/unit/c/test-utf-is_punctuation.h new file mode 100644 index 0000000..7168885 --- /dev/null +++ b/level_0/f_utf/tests/unit/c/test-utf-is_punctuation.h @@ -0,0 +1,20 @@ +/** + * FLL - Level 0 + * + * Project: UTF + * API Version: 0.5 + * Licenses: lgpl-2.1-or-later + * + * Test the function in the utf project. + */ +#ifndef _TEST__F_utf_is_punctuation_h +#define _TEST__F_utf_is_punctuation_h + +/** + * Test that the function works. + * + * @see f_utf_is_punctuation() + */ +extern void test__f_utf_is_punctuation__works(void **state); + +#endif // _TEST__F_utf_is_punctuation_h diff --git a/level_0/f_utf/tests/unit/c/test-utf-is_symbol.c b/level_0/f_utf/tests/unit/c/test-utf-is_symbol.c index c2ef83e..509198c 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-is_symbol.c +++ b/level_0/f_utf/tests/unit/c/test-utf-is_symbol.c @@ -49,7 +49,6 @@ void test__f_utf_is_symbol__works(void **state) { fclose(file); } - } #ifdef __cplusplus diff --git a/level_0/f_utf/tests/unit/c/test-utf.c b/level_0/f_utf/tests/unit/c/test-utf.c index f3f20d3..0044053 100644 --- a/level_0/f_utf/tests/unit/c/test-utf.c +++ b/level_0/f_utf/tests/unit/c/test-utf.c @@ -25,6 +25,7 @@ int main(void) { cmocka_unit_test(test__f_utf_append_nulless__works), cmocka_unit_test(test__f_utf_character_is_private__works), + cmocka_unit_test(test__f_utf_character_is_punctuation__works), cmocka_unit_test(test__f_utf_character_is_symbol__works), cmocka_unit_test(test__f_utf_dynamic_adjust__works), @@ -116,6 +117,7 @@ int main(void) { cmocka_unit_test(test__f_utf_dynamicss_resize__works), cmocka_unit_test(test__f_utf_is_private__works), + cmocka_unit_test(test__f_utf_is_punctuation__works), cmocka_unit_test(test__f_utf_is_symbol__works), cmocka_unit_test(test__f_utf_map_multis_adjust__works), diff --git a/level_0/f_utf/tests/unit/c/test-utf.h b/level_0/f_utf/tests/unit/c/test-utf.h index 45b3a93..fbb37fb 100644 --- a/level_0/f_utf/tests/unit/c/test-utf.h +++ b/level_0/f_utf/tests/unit/c/test-utf.h @@ -34,6 +34,7 @@ #include "test-utf-append_assure_nulless.h" #include "test-utf-append_nulless.h" #include "test-utf-character_is_private.h" +#include "test-utf-character_is_punctuation.h" #include "test-utf-character_is_symbol.h" #include "test-utf-dynamic_adjust.h" #include "test-utf-dynamic_append.h" @@ -87,6 +88,7 @@ #include "test-utf-dynamicss_increase_by.h" #include "test-utf-dynamicss_resize.h" #include "test-utf-is_private.h" +#include "test-utf-is_punctuation.h" #include "test-utf-is_symbol.h" #include "test-utf-map_multis_adjust.h" #include "test-utf-map_multis_append.h" -- 1.8.3.1