]> source.dussan.org Git - rspamd.git/commitdiff
Add tests for tokenizer bug.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 May 2015 21:53:09 +0000 (22:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 20 May 2015 21:53:09 +0000 (22:53 +0100)
src/lua/lua_util.c
test/lua/unit/tokenizer.lua

index 37bf98ead73f2c9b8bf865d7211af30ef89ecb1e..f1c84820135cf307c6678e5d79537e5c782cf120 100644 (file)
@@ -330,7 +330,7 @@ lua_util_tokenize_text (lua_State *L)
                for (i = 0; i < res->len; i ++) {
                        w = &g_array_index (res, rspamd_fstring_t, i);
                        lua_pushlstring (L, w->begin, w->len);
-                       lua_settable (L, i + 1);
+                       lua_rawseti (L, -2, i + 1);
                }
        }
 
index de15a6bd7d6e565ea6ca02cce38e2cce356ab879..628d7029870976683a733b302e378dde133701af 100644 (file)
@@ -8,6 +8,9 @@ context("Text tokenization test", function()
         "Integer", "mattis", "nibh"
         }
       },
+      {"Հետաքրքրվողների համար ոտորև ներկայացված",
+        {"Հետաքրքրվողների", "համար", "ոտորև", "ներկայացված"}
+      },
     }
     
     for _,c in ipairs(cases) do