Skip to content

Commit 2968009

Browse files
authored
Clarify taptest.strict behavior (#3010)
* Clarify taptest.strict behavior * Format headings by style guide Resolves #2703
1 parent a2e5a48 commit 2968009

File tree

2 files changed

+62
-16
lines changed
  • doc/reference/reference_lua
  • locale/ru/LC_MESSAGES/reference/reference_lua

2 files changed

+62
-16
lines changed

doc/reference/reference_lua/tap.rst

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
-------------------------------------------------------------------------------
2-
Module tap
3-
-------------------------------------------------------------------------------
1+
Module tap
2+
==========
43

5-
===============================================================================
6-
Overview
7-
===============================================================================
4+
Overview
5+
--------
86

97
The ``tap`` module streamlines the testing of other modules. It allows writing
108
of tests in the
@@ -14,9 +12,8 @@ standard TAP-analyzers so they can be passed to utilities such as
1412
one can run tests and then use the results for statistics, decision-making, and
1513
so on.
1614

17-
===============================================================================
18-
Index
19-
===============================================================================
15+
Index
16+
-----
2017

2118
.. container:: table
2219

@@ -342,11 +339,25 @@ so on.
342339
and :ref:`taptest:is_deeply() <taptest-is_deeply>`
343340
must be compared strictly with ``nil``.
344341
Set ``taptest.strict=false`` if ``nil`` and ``box.NULL`` both have the same effect.
342+
345343
The default is false.
346344
For example, if and only if ``taptest.strict=true`` has happened,
347345
then ``taptest:is_deeply({a = box.NULL}, {})``
348346
will return ``false``.
349347

348+
Since :tarantool-release:`2.8.3`, ``taptest.strict`` is inherited in all subtests:
349+
350+
.. code-block:: lua
351+
352+
t = require('tap').test('123')
353+
t.strict = true
354+
355+
t:is_deeply({a = box.NULL}, {}) -- false
356+
357+
t:test('subtest', function(t)
358+
t:is_deeply({a = box.NULL}, {}) -- also false
359+
end)
360+
350361
351362
.. _tap-example:
352363

locale/ru/LC_MESSAGES/reference/reference_lua/tap.po

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

2-
msgid "Module `tap`"
2+
#, fuzzy
3+
msgid "Module tap"
34
msgstr "Модуль `tap`"
45

56
msgid "Overview"
@@ -200,9 +201,9 @@ msgid ""
200201
msgstr ""
201202
"Такую проверку следует проводить только по завершении всех запланированных "
202203
"тестов, поэтому как правило, ``taptest:check()`` появится лишь в конце "
203-
"скрипта. Тем не менее, в качестве расширения Tarantool, "
204-
"``taptest:check()`` может появиться в начале любого подтеста. Таким образом,"
205-
" проверка появится в трех случаях:"
204+
"скрипта. Тем не менее, в качестве расширения Tarantool, ``taptest:check()`` "
205+
"может появиться в начале любого подтеста. Таким образом, проверка появится в"
206+
" трех случаях:"
206207

207208
msgid "by calling ``taptest:check()`` at the end of a script,"
208209
msgstr "при вызове ``taptest:check()`` в конце скрипта,"
@@ -360,14 +361,35 @@ msgstr ""
360361
"Проверка соответствия значения определенному типу. Отображается длинное "
361362
"сообщение, если значение не принадлежит указанному типу."
362363

364+
msgid "value the type of which is to be checked"
365+
msgstr ""
366+
367+
msgid "type of data that a passed value should have"
368+
msgstr ""
369+
370+
msgid "text that will be shown to the user in case of failure"
371+
msgstr ""
372+
373+
msgid ""
374+
"test:iscdata(slab_info.quota_size, ffi.typeof('uint64_t'), "
375+
"'memcached.slab.info().quota_size returns a cdata')"
376+
msgstr ""
377+
363378
msgid ""
364379
"Set ``taptest.strict=true`` if :ref:`taptest:is() <taptest-is>` and "
365380
":ref:`taptest:isnt() <taptest-isnt>` and :ref:`taptest:is_deeply() <taptest-"
366381
"is_deeply>` must be compared strictly with ``nil``. Set "
367382
"``taptest.strict=false`` if ``nil`` and ``box.NULL`` both have the same "
368-
"effect. The default is false. For example, if and only if "
369-
"``taptest.strict=true`` has happened, then ``taptest:is_deeply({a = "
370-
"box.NULL}, {})`` will return ``false``."
383+
"effect."
384+
msgstr ""
385+
386+
msgid ""
387+
"The default is false. For example, if and only if ``taptest.strict=true`` "
388+
"has happened, then ``taptest:is_deeply({a = box.NULL}, {})`` will return "
389+
"``false``."
390+
msgstr ""
391+
392+
msgid "Note that ``taptest.strict`` is the same for all subtests:"
371393
msgstr ""
372394

373395
msgid "Example"
@@ -431,3 +453,16 @@ msgstr ""
431453
" ok - 2 + 3 is not 4\n"
432454
" # Some subtests for test2: end\n"
433455
"ok - some subtests for test2"
456+
457+
#~ msgid ""
458+
#~ "Set ``taptest.strict=true`` if :ref:`taptest:is() <taptest-is>` and "
459+
#~ ":ref:`taptest:isnt() <taptest-isnt>` and :ref:`taptest:is_deeply() <taptest-"
460+
#~ "is_deeply>` must be compared strictly with ``nil``. Set "
461+
#~ "``taptest.strict=false`` if ``nil`` and ``box.NULL`` both have the same "
462+
#~ "effect. The default is false. For example, if and only if "
463+
#~ "``taptest.strict=true`` has happened, then ``taptest:is_deeply({a = "
464+
#~ "box.NULL}, {})`` will return ``false``."
465+
#~ msgstr ""
466+
467+
#~ msgid "Note that ``taptest.strict`` is the same for subtests:"
468+
#~ msgstr ""

0 commit comments

Comments
 (0)