Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org,
	Konstantin Osipov <kostja.osipov@gmail.com>
Cc: vdavydov.dev@gmail.com
Subject: Re: [tarantool-patches] Re: [PATCH v2 1/5] lib: introduce json_path_is_multikey helper
Date: Tue, 2 Apr 2019 18:49:23 +0300	[thread overview]
Message-ID: <c28a023c-81d7-b79c-8e24-93b5281e5078@tarantool.org> (raw)
In-Reply-To: <20190319154324.GE32279@chai>

Hi! Thank you for participating. We decided to introduce the other
helper json_multikey_path_offset 

/**
 * Scan the JSON path string and return the offset of the first
 * character [*] (the array index placeholder).
 * - if [*] is not found, -1 is returned.
 * - specified JSON path must be valid
 *   (may be tested with json_path_validate).
 */
int
json_path_multikey_offset(const char *path, int path_len, int index_base);

> This coverage is insufficient. You should at least test an empty
> path, a path with * in the beginning, middle and end.

I tried to take all the cases into account. In fact, this is not really necessary
because corner cases already well covered by tests (for json_lexer_next_token).

	static struct {
		const char *str;
		int rc;
	} test_cases[] = {
		{"", -1},
		{"[1]Data[1]extra[1]", -1},
		{"[*]Data[1]extra[1]", 0},
		{"[*]Data[*]extra[1]", 0},
		{"[1]Data[*]extra[1]", 7},
		{"[1]Data[1]extra[*]", 15},
	};


I've resend the whole patchset.

  reply	other threads:[~2019-04-02 15:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 12:32 [PATCH v2 0/5] box: introduce multikey indexes in memtx Kirill Shcherbatov
2019-03-19 12:32 ` [PATCH v2 1/5] lib: introduce json_path_is_multikey helper Kirill Shcherbatov
2019-03-19 15:43   ` [tarantool-patches] " Konstantin Osipov
2019-04-02 15:49     ` Kirill Shcherbatov [this message]
2019-03-19 12:32 ` [PATCH v2 2/5] lib: introduce is_weak_cmp flag for json_path_cmp Kirill Shcherbatov
2019-03-19 15:47   ` [tarantool-patches] " Konstantin Osipov
2019-03-19 12:32 ` [PATCH v2 3/5] box: move offset_slot init to tuple_format_add_field Kirill Shcherbatov
2019-03-19 12:32 ` [PATCH v2 4/5] box: introduce field_map_builder for field_map init Kirill Shcherbatov
2019-03-19 12:32 ` [PATCH v2 5/5] box: introduce multikey indexes in memtx Kirill Shcherbatov
2019-03-19 16:05   ` [tarantool-patches] " Kirill Shcherbatov
2019-03-21 12:35   ` Kirill Shcherbatov
2019-03-28 10:21 ` [PATCH v2 0/5] " Vladimir Davydov
2019-04-02 15:49   ` [tarantool-patches] " Kirill Shcherbatov

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=c28a023c-81d7-b79c-8e24-93b5281e5078@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] Re: [PATCH v2 1/5] lib: introduce json_path_is_multikey helper' \
    /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