From be96e907e7ae9082a7a14a24c45af2781b893ede Mon Sep 17 00:00:00 2001 From: Patience Daur Date: Fri, 8 Jul 2022 14:59:21 +0300 Subject: [PATCH 1/3] Format headings by style guide --- doc/reference/reference_lua/tap.rst | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/reference/reference_lua/tap.rst b/doc/reference/reference_lua/tap.rst index 9cb30cf3dd..9979469ed1 100644 --- a/doc/reference/reference_lua/tap.rst +++ b/doc/reference/reference_lua/tap.rst @@ -1,10 +1,8 @@ -------------------------------------------------------------------------------- - Module tap -------------------------------------------------------------------------------- +Module tap +========== -=============================================================================== - Overview -=============================================================================== +Overview +-------- The ``tap`` module streamlines the testing of other modules. It allows writing of tests in the @@ -14,9 +12,8 @@ standard TAP-analyzers so they can be passed to utilities such as one can run tests and then use the results for statistics, decision-making, and so on. -=============================================================================== - Index -=============================================================================== +Index +----- .. container:: table From 12d57648a73f1b62f1c2ad8c92cc8c3285b0f3da Mon Sep 17 00:00:00 2001 From: Patience Daur Date: Fri, 8 Jul 2022 15:07:10 +0300 Subject: [PATCH 2/3] Clarify taptest.strict behavior Resolves #2703 --- doc/reference/reference_lua/tap.rst | 14 ++++++ .../reference/reference_lua/tap.po | 49 ++++++++++++++++--- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/doc/reference/reference_lua/tap.rst b/doc/reference/reference_lua/tap.rst index 9979469ed1..808c5eb4f1 100644 --- a/doc/reference/reference_lua/tap.rst +++ b/doc/reference/reference_lua/tap.rst @@ -339,11 +339,25 @@ Index and :ref:`taptest:is_deeply() ` must be compared strictly with ``nil``. Set ``taptest.strict=false`` if ``nil`` and ``box.NULL`` both have the same effect. + The default is false. For example, if and only if ``taptest.strict=true`` has happened, then ``taptest:is_deeply({a = box.NULL}, {})`` will return ``false``. + Since :tarantool-release:`2.8.3`, ``taptest.strict`` is inherited in all subtests: + + .. code-block: tarantoolsession + + t = require('tap').test('123') + t.strict = true + + t:is_deeply({a = box.NULL}, {}) -- false + + t:test('subtest', function(t) + t:is_deeply({a = box.NULL}, {}) -- also false + end) + .. _tap-example: diff --git a/locale/ru/LC_MESSAGES/reference/reference_lua/tap.po b/locale/ru/LC_MESSAGES/reference/reference_lua/tap.po index 775e18febf..103cb083b7 100644 --- a/locale/ru/LC_MESSAGES/reference/reference_lua/tap.po +++ b/locale/ru/LC_MESSAGES/reference/reference_lua/tap.po @@ -1,5 +1,6 @@ -msgid "Module `tap`" +#, fuzzy +msgid "Module tap" msgstr "Модуль `tap`" msgid "Overview" @@ -200,9 +201,9 @@ msgid "" msgstr "" "Такую проверку следует проводить только по завершении всех запланированных " "тестов, поэтому как правило, ``taptest:check()`` появится лишь в конце " -"скрипта. Тем не менее, в качестве расширения Tarantool, " -"``taptest:check()`` может появиться в начале любого подтеста. Таким образом," -" проверка появится в трех случаях:" +"скрипта. Тем не менее, в качестве расширения Tarantool, ``taptest:check()`` " +"может появиться в начале любого подтеста. Таким образом, проверка появится в" +" трех случаях:" msgid "by calling ``taptest:check()`` at the end of a script," msgstr "при вызове ``taptest:check()`` в конце скрипта," @@ -360,14 +361,35 @@ msgstr "" "Проверка соответствия значения определенному типу. Отображается длинное " "сообщение, если значение не принадлежит указанному типу." +msgid "value the type of which is to be checked" +msgstr "" + +msgid "type of data that a passed value should have" +msgstr "" + +msgid "text that will be shown to the user in case of failure" +msgstr "" + +msgid "" +"test:iscdata(slab_info.quota_size, ffi.typeof('uint64_t'), " +"'memcached.slab.info().quota_size returns a cdata')" +msgstr "" + msgid "" "Set ``taptest.strict=true`` if :ref:`taptest:is() ` and " ":ref:`taptest:isnt() ` and :ref:`taptest:is_deeply() ` must be compared strictly with ``nil``. Set " "``taptest.strict=false`` if ``nil`` and ``box.NULL`` both have the same " -"effect. The default is false. For example, if and only if " -"``taptest.strict=true`` has happened, then ``taptest:is_deeply({a = " -"box.NULL}, {})`` will return ``false``." +"effect." +msgstr "" + +msgid "" +"The default is false. For example, if and only if ``taptest.strict=true`` " +"has happened, then ``taptest:is_deeply({a = box.NULL}, {})`` will return " +"``false``." +msgstr "" + +msgid "Note that ``taptest.strict`` is the same for all subtests:" msgstr "" msgid "Example" @@ -431,3 +453,16 @@ msgstr "" " ok - 2 + 3 is not 4\n" " # Some subtests for test2: end\n" "ok - some subtests for test2" + +#~ msgid "" +#~ "Set ``taptest.strict=true`` if :ref:`taptest:is() ` and " +#~ ":ref:`taptest:isnt() ` and :ref:`taptest:is_deeply() ` must be compared strictly with ``nil``. Set " +#~ "``taptest.strict=false`` if ``nil`` and ``box.NULL`` both have the same " +#~ "effect. The default is false. For example, if and only if " +#~ "``taptest.strict=true`` has happened, then ``taptest:is_deeply({a = " +#~ "box.NULL}, {})`` will return ``false``." +#~ msgstr "" + +#~ msgid "Note that ``taptest.strict`` is the same for subtests:" +#~ msgstr "" From cfcb24ee69d3121defb889fcdc79b142836cf11f Mon Sep 17 00:00:00 2001 From: Patience Daur Date: Fri, 8 Jul 2022 15:29:40 +0300 Subject: [PATCH 3/3] Display example --- doc/reference/reference_lua/tap.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/tap.rst b/doc/reference/reference_lua/tap.rst index 808c5eb4f1..2540d0fff2 100644 --- a/doc/reference/reference_lua/tap.rst +++ b/doc/reference/reference_lua/tap.rst @@ -347,7 +347,7 @@ Index Since :tarantool-release:`2.8.3`, ``taptest.strict`` is inherited in all subtests: - .. code-block: tarantoolsession + .. code-block:: lua t = require('tap').test('123') t.strict = true