#35961 closed enhancement (fixed)
Unit tests for _n_noop & _nx_noop
Reported by: | realloc | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
I created the unit tests for _n_noop and _nx_noop. Additionally, I corrected a typo in the description of _n_noop.
Attachments (3)
Change History (12)
#1
follow-up:
↓ 2
@
9 years ago
- Keywords has-patch needs-refresh added
That's not a typo, just a third-person singular verb.
#2
in reply to:
↑ 1
@
9 years ago
Replying to swissspidy:
That's not a typo, just a third-person singular verb.
I don't think so ... at least, it's inconsistent. Please have a look at the description of _nx_noop ;)
#3
follow-up:
↓ 4
@
9 years ago
Yes, the docs are inconsistent. As per the handbook, third-person singular verbs should be used to describe what a function does. For example:
Registers plural strings in POT file, but doesn't translate them.
@realloc Would you mind creating a separate patch for the docs changes of these two functions?
#4
in reply to:
↑ 3
@
9 years ago
- Keywords has-unit-tests added; needs-refresh removed
Replying to swissspidy:
@realloc Would you mind creating a separate patch for the docs changes of these two functions?
Ok, thanks for pointing that out. This time, I asked also my English teacher - jut to be sure. :-D
#5
follow-up:
↓ 6
@
9 years ago
- Milestone changed from Awaiting Review to Future Release
- Version trunk deleted
Thanks again for writing tests, @realloc!
I think these tests are too tightly coupled to the internal implementation of _n_noop()
and _nx_noop()
. Testing that the function returns an array containing those elements is ok, but what really needs to be tested is whether their return values work when they're passed to translate_nooped_plural()
. Testing the return value doesn't really prove anything with regard to these particular functions.
I think it would be better to combine the tests with some for translate_nooped_plural()
, that way we ensure that the *_noop()
functions correctly interact with translate_nooped_plural()
.
#6
in reply to:
↑ 5
@
9 years ago
Replying to johnbillion:
I think it would be better to combine the tests with some for
translate_nooped_plural()
, that way we ensure that the*_noop()
functions correctly interact withtranslate_nooped_plural()
.
Thank you very much for helping here, John. I changed the tests so that these functions interact with translate_nooped_plural()
now.
Unit tests and correction of type in phpdoc of _n_noop