[Groonga-commit] groonga/groonga [master] handle both no select results are the same result.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 9日 (金) 13:05:31 JST


Kouhei Sutou	2010-07-09 04:05:31 +0000 (Fri, 09 Jul 2010)

  New Revision: 71d707aef564a24992ef643e0be2d8e510c93819

  Log:
    handle both no select results are the same result.

  Modified files:
    src/grntest.c

  Modified: src/grntest.c (+10 -2)
===================================================================
--- src/grntest.c    2010-07-08 14:23:11 +0000 (fe94457)
+++ src/grntest.c    2010-07-09 04:05:31 +0000 (38a8adb)
@@ -532,7 +532,11 @@ diff_result(char *expect, int elen, char *result, int rlen)
     fprintf(stderr, " is not groonga command output\n", );
     return 1;
 */
-    e = expect;
+    if (elen > 2 && strncmp(expect + elen - 2, "]]", 2)) {
+      e = expect + elen;
+    } else {
+      e = expect;
+    }
   }
 
   i = 0;
@@ -551,7 +555,11 @@ diff_result(char *expect, int elen, char *result, int rlen)
     fprintf(stderr, " is not groonga command output\n");
     return 1;
 */
-    r = result;
+    if (rlen > 2 && strncmp(result + rlen - 2, "]]", 2)) {
+      r = result + rlen;
+    } else {
+      r = result;
+    }
   }
 
   return strncmp(e, r, strlen(e));




Groonga-commit メーリングリストの案内
Back to archive index