Fix randomly failing unit test spotted in pull request #2633 #2634
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Unit test in line 153 of
test_ja_locale.rb
was failing randomly. Reason for this failure was Latin character in Japanese localisation.Line 153 says:
This method is as follows:
Basically, this is to say, the unit test use Regex match to test for Latin alphabet and will fail with every Latin alphabet. I had a look and noticed an interesting element in
characters
array ofsuper_mario
in Japanese localisation,lib/locales/ja/super_mario.yml
:I isolated the test case into an array of single element and noticed that this was the problematic element which caused the unit test to fail.
I removed the element, as the
assert_not_match
requires strict Latin alphabet.This should let @alextaujenis to uncomment the line. As a further suggestion, maybe there should be YML check which checks for Latin characters for future generators which are using
assert_not_english
method in unit tests. If Latin character is spotted, fail the test.Thanks,
Juha