From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 91B0E29DC6 for ; Wed, 3 Oct 2018 10:20:31 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id geX90lTwHZJf for ; Wed, 3 Oct 2018 10:20:31 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id C4C4129A31 for ; Wed, 3 Oct 2018 10:20:30 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] box: add tuple:size function References: <1538070923-23087-1-git-send-email-ivushkinalex@gmail.com> From: Vladislav Shpilevoy Message-ID: Date: Wed, 3 Oct 2018 17:20:28 +0300 MIME-Version: 1.0 In-Reply-To: <1538070923-23087-1-git-send-email-ivushkinalex@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, AlexeyIvushkin Hi! Thanks for the patch! On 27/09/2018 20:55, AlexeyIvushkin wrote: > From: Morgan-iv > > When operating with tuples, we only have tuple:bsize function > to get size of tuple. tuple:bsize returns only size of MessagePack > part of struct tuple, without tuple_meta. New function tuple:size > returns size of all tuple, with MessagePack and tuple_meta > > Closes #2256 Please, write here a documentation request to fix doc of tuple:bsize (it returns Message Pack size only) and to describe the new method tuple:size(). How to write documentation requests in a commit see tarantool/docbot repository and commits like this: https://github.com/tarantool/tarantool/commit/1663bdc4a86fa6fd43903d2d52dd5a743b87f33b > --- > https://github.com/tarantool/tarantool/issues/2256 > https://github.com/tarantool/tarantool/tree/Morgan-iv/gh-2256 > src/box/lua/tuple.c | 10 ++++++++++ > src/box/lua/tuple.lua | 1 + > test/box/tuple.result | 12 ++++++++++++ > test/box/tuple.test.lua | 6 ++++++ > 4 files changed, 29 insertions(+) > > diff --git a/test/box/tuple.result b/test/box/tuple.result > index e035cb9..418f5f8 100644 > --- a/test/box/tuple.result > +++ b/test/box/tuple.result > @@ -186,6 +186,18 @@ t:bsize() > --- > - 5 > ... > +-- tuple:size() Please, put more details in the comment about the issue. See other tests. The comment should look like: -- -- gh-: . -- ... a test ... > +t = box.tuple.new('abc') > +--- > +... > +t > +--- > +- ['abc'] > +... > +t:size() > +--- > +- 15 > +... > -- > -- Test cases for #106 box.tuple.new fails on multiple items > --