From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 93015469719 for ; Wed, 4 Mar 2020 01:49:14 +0300 (MSK) References: <20200117170801.34975-1-maria.khaydich@tarantool.org> <1580141630.390723821@f500.i.mail.ru> <20200226135059.GJ404@tarantool.org> <1583258709.640377144@f153.i.mail.ru> From: Vladislav Shpilevoy Message-ID: <4d2bb331-d104-3e45-c84c-580cdfdbf1a7@tarantool.org> Date: Tue, 3 Mar 2020 23:49:12 +0100 MIME-Version: 1.0 In-Reply-To: <1583258709.640377144@f153.i.mail.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] box: netbox.self and connect should work interchangeably List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maria Khaydich , Igor Munkin Cc: tarantool-patches@dev.tarantool.org Thanks for the patch! See 2 comments below. > diff --git a/test/box/gh-4513-netbox-self-and-connect-interchangeable.result b/test/box/gh-4513-netbox-self-and-connect-interchangeable.result > new file mode 100644 > index 000000000..fa41b2442 > --- /dev/null > +++ b/test/box/gh-4513-netbox-self-and-connect-interchangeable.result > @@ -0,0 +1,44 @@ > +-- test-run result file version 2 > +netbox = require('net.box') > + | --- > + | ... > +test_run = require('test_run').new() > + | --- > + | ... > +remote = test_run:get_cfg('remote') == 'true' > + | --- > + | ... > +test_run:cmd("setopt delimiter ';'") > + | --- > + | - true > + | ... > + > +nb = nil > +if remote then > + box.schema.user.grant('guest','super') 1. Grant was given, but was not revoked. This can affect next tests running on the same instance. > + nb = netbox.connect(box.cfg.listen) > +else > + nb = netbox.self > +end; > + | --- > + | ... > +test_run:cmd("setopt delimiter ''"); 2. We have a nice syntax of '\' to create multi-line expressions like this. For such a small piece of code this would look better than 2 'setopt delimiter', IMO. Up to you. > + | --- > + | - true > + | ... > + > +-- > +-- netbox:self and netbox:connect should work interchangeably > +-- > +type(nb:eval('return box.tuple.new{1}')) -- table > + | --- > + | - table > + | ... > +type(nb:eval('return box.error.new(1, "test error")')) -- string > + | --- > + | - string > + | ... > +type(nb:eval('return box.NULL')) -- cdata > + | --- > + | - cdata > + | ...