[Tarantool-patches] [PATCH luajit 1/5] test: introduce `samevalues()` TAP checker
Sergey Bronnikov
sergeyb at tarantool.org
Fri Aug 18 14:12:17 MSK 2023
Hi,
On 8/18/23 13:58, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Please, consider my comments below.
>
> On 18.08.23, Sergey Bronnikov wrote:
>> Hi, Sergey
>>
>>
>> Thanks for the patch! See my comments inline.
>>
>>
>> On 8/15/23 12:36, Sergey Kaplun wrote:
>>> The introduced `samevalues()` helper checks that values in range from
>>> 1, to `table.maxn()` of the given table are exactly the same. It may be
>>> usefull for test consistency of JIT and VM behaviour. Originally, the
>>> `arr_is_consistent()` function was introduced in the
>>> <tarantool-tests/gh-6163-min-max.test.lua>. `samevalues()` has the same
>>> functionallity (except usage of `table.maxn()` instead `#` operator to
>>> be sure, that the table we check isn't a sparse array).
>> I would rename samevalues to something like assert_equals or
>> assert_items_equals just because
>>
>> similar functions are named in unit testing frameworks and helpers with
>> prefix assert_
> As you can see we use naming without _ for exported function in the
> <tap.lua> module, so additional one with strange naming will be
> inconsistent.
>
> Also, discussed this naming with Igor and Max offline and this name is
> OK for them, feel free also to CC Igor to discuss:).
>
>> more readable from my point of view. See names for assertions in luatest
>> [1] and JUnit (popular unit testing framework).
>>
>>
>> 1. https://github.com/tarantool/luatest#list-of-luatest-functions
>>
>> 2.
>> https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html
>>
>>
Igor, what do you think regarding naming of the introduced function?
More information about the Tarantool-patches
mailing list