Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Maria Khaydich <maria.khaydich@tarantool.org>,
	Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] box: netbox.self and connect should work interchangeably
Date: Tue, 3 Mar 2020 23:49:12 +0100	[thread overview]
Message-ID: <4d2bb331-d104-3e45-c84c-580cdfdbf1a7@tarantool.org> (raw)
In-Reply-To: <1583258709.640377144@f153.i.mail.ru>

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
> + | ...

  reply	other threads:[~2020-03-03 22:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 17:08 Maria
2020-01-20 21:22 ` Vladislav Shpilevoy
2020-01-27 16:13   ` Maria Khaydich
2020-02-26 13:51     ` Igor Munkin
2020-03-03 18:05       ` Maria Khaydich
2020-03-03 22:49         ` Vladislav Shpilevoy [this message]
2020-03-06 12:19           ` Maria Khaydich
2020-03-08 22:57             ` Vladislav Shpilevoy
  -- strict thread matches above, loose matches on Subject: below --
2019-12-12 21:28 Maria
2019-12-13 13:53 ` Oleg Babin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d2bb331-d104-3e45-c84c-580cdfdbf1a7@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=maria.khaydich@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box: netbox.self and connect should work interchangeably' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox