[Groonga-commit] groonga/groonga at 9443ba1 [master] mrb: support mruby false to groonga object conversion

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Oct 8 22:09:06 JST 2013


Kouhei Sutou	2013-10-08 22:09:06 +0900 (Tue, 08 Oct 2013)

  New Revision: 9443ba1a7138602ea363121c84f9f0189e3e0f81
  https://github.com/groonga/groonga/commit/9443ba1a7138602ea363121c84f9f0189e3e0f81

  Message:
    mrb: support mruby false to groonga object conversion

  Added files:
    test/command/suite/ruby/eval/false.expected
    test/command/suite/ruby/eval/false.test
  Modified files:
    lib/mrb.c

  Modified: lib/mrb.c (+2 -1)
===================================================================
--- lib/mrb.c    2013-10-08 22:07:38 +0900 (ec69fef)
+++ lib/mrb.c    2013-10-08 22:09:06 +0900 (7163329)
@@ -158,7 +158,8 @@ grn_mrb_to_grn(grn_ctx *ctx, mrb_value mrb_object, grn_obj *grn_object)
     if (mrb_nil_p(mrb_object)) {
       grn_obj_reinit(ctx, grn_object, GRN_DB_VOID, 0);
     } else {
-      rc = GRN_INVALID_ARGUMENT;
+      grn_obj_reinit(ctx, grn_object, GRN_DB_BOOL, 0);
+      GRN_BOOL_SET(ctx, grn_object, GRN_FALSE);
     }
     break;
   case MRB_TT_FIXNUM :

  Added: test/command/suite/ruby/eval/false.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/ruby/eval/false.expected    2013-10-08 22:09:06 +0900 (4af3922)
@@ -0,0 +1,4 @@
+register ruby/eval
+[[0,0.0,0.0],true]
+ruby_eval "false"
+[[0,0.0,0.0],{"value":false}]

  Added: test/command/suite/ruby/eval/false.test (+5 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/ruby/eval/false.test    2013-10-08 22:09:06 +0900 (a2084b8)
@@ -0,0 +1,5 @@
+#@on-error omit
+register ruby/eval
+#@on-error default
+
+ruby_eval "false"
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index