enum.c 、enumerator.c 、numeric.c 、pack.c 、range.c 、file.c の網羅的なテストを追加して、現在のカバレッジは 76.34% です。そろそろ伸びが鈍くなってきました。
enum.c だの range.c だののデータ構造はテストが自然とポータブルになって楽だったんですが、file.c などでは環境に依存するテストが増えてなかなかカバレッジが上がりません。例えば、mswin32 では chmod が言うこときかないとか。
>ruby -e 'File.chmod(0222, "foo"); p "%o" % File.stat("foo").mode' "100644"
言うとおりのパーミッションにできないなら例外投げて欲しいなあ。
以下、Debian etch で make test; make test-all した後の各ファイルのカバレッジ。テストが書きやすそう、かつ、カバレッジ稼げそうという意味で、正規表現がねらい目?
100.00% (8 of 8) vm_evalbody.c 100.00% (6 of 6) main.c 100.00% (43 of 43) inits.c 100.00% (4 of 4) prelude.c 100.00% (39 of 39) id.c 100.00% (3 of 3) miniprelude.c 100.00% (2 of 2) dmyext.c 99.82% (552 of 553) enum.c 99.40% (331 of 333) range.c 98.87% (872 of 882) pack.c 98.87% (175 of 177) enumerator.c 98.51% (132 of 134) math.c 97.30% (432 of 444) sprintf.c 96.80% (967 of 999) numeric.c 96.17% (251 of 261) cont.c 94.92% (299 of 315) struct.c 92.88% (1108 of 1193) bignum.c 91.77% (2342 of 2552) string.c 91.62% (1061 of 1158) array.c 90.69% (565 of 623) vm_insnhelper.c 89.95% (197 of 219) transcode.c 88.89% (160 of 180) random.c 88.25% (338 of 383) class.c 87.47% (1054 of 1205) file.c 87.42% (681 of 779) marshal.c 85.64% (1920 of 2242) compile.c 83.17% (578 of 695) object.c 82.95% (219 of 264) eval_method.c 82.94% (661 of 797) vm.c 82.58% (1029 of 1246) re.c 82.46% (47 of 57) compar.c 81.30% (439 of 540) encoding.c 80.90% (830 of 1026) thread.c 80.70% (828 of 1026) eval.c 80.08% (631 of 788) gc.c 79.77% (548 of 687) dir.c 79.68% (443 of 556) error.c 79.65% (137 of 172) thread_pthread.c 79.57% (257 of 323) load.c 79.10% (265 of 335) st.c 77.40% (387 of 500) proc.c 76.48% (647 of 846) variable.c 76.34% (30638 of 40133) total 74.90% (191 of 255) parse.c 71.02% (1652 of 2326) regcomp.c 70.40% (88 of 125) eval_jump.c 70.19% (226 of 322) signal.c 69.88% (58 of 83) dln.c 68.36% (646 of 945) hash.c 65.34% (1627 of 2490) io.c 64.47% (98 of 152) eval_error.c 64.44% (29 of 45) eval_safe.c 60.50% (481 of 795) time.c 59.80% (1526 of 2552) regparse.c 59.10% (367 of 621) ruby.c 58.17% (765 of 1315) regexec.c 56.25% (9 of 16) version.c 56.20% (675 of 1201) util.c 49.58% (409 of 825) process.c 38.21% (115 of 301) regenc.c 36.00% (9 of 25) prec.c 30.60% (179 of 585) iseq.c 0.00% (0 of 44) regsyntax.c 0.00% (0 of 26) debug.c 0.00% (0 of 193) vm_dump.c 0.00% (0 of 161) regerror.c 0.00% (0 of 135) blockinlining.c