咳といいます。 > |後者(return)はまだ準備できていませんが、前者(break)はdrbのrunit/test_drb.rbです。 > |irbではこんな感じです。 > > 今朝調べてみたら、純正1.8.0ではbreakでは例外をあげていません > でした。以下のパッチでどうでしょう。 > > returnの方は引き続きお待ちしております。 > > --- eval.c 12 Sep 2003 03:30:45 -0000 1.535 > +++ eval.c 17 Sep 2003 03:25:36 -0000 > @@ -4030,3 +4030,3 @@ localjump_destination(state, scope, retv > while (tt) { > - if (tt->tag == PROT_PCALL || > + if (tt->tag == PROT_PCALL || (tt->tag == PROT_THREAD && state == TAG_BREAK) || > (tt->tag == PROT_CALL || tt->tag == tag) && tt->scope == scope) { > @@ -4038,4 +4038,3 @@ localjump_destination(state, scope, retv > if (tt->tag == PROT_THREAD) { > - rb_raise(rb_eThreadError, "%s jump can't across threads", > - (state == TAG_BREAK) ? "break" : "return"); > + rb_raise(rb_eThreadError, "return jump can't across threads"); > } > だいたい通るようになったのですが、値つきのbreakのテストがNGでした。 def test_07_break_18 ary = [] result = @there.each do |x| ary.push x break(:done) if x == 4 end assert_equal([1, 2, 'III', 4], ary) assert_equal(:done, result) end それだけのコードを準備できなかったのですが、この検査が通りません。 expected:<done> but was:<nil> (RUNIT::AssertionFailedError) 例外のexit_valueがnilになっているのかしら。 returnは再現する短いアプリケーションがあるので、抜きだそうと思います。 (src/app/div/sampleにあるんですけどね) もうしばらくお待ち下さい。