Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translator tester: Be more vigilant against empty test cases. #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zoe-translates
Copy link

The test cases in a translator script may be empty, not just with an empty array for var testCases, but in the sense of completely missing.

In that case, don't pass invalid JSON (all whitespaces or empty string) to JSON.parse(), and use an empty array instead.

This fixes an annoying SyntaxError in the console while loading the file Ovid.js in the translators repository. That translator should be fixed, too.

The test cases in a translator script may be empty, not just with an
empty array for `var testCases`, but in the sense of completely missing.

In that case, don't pass invalid JSON (all whitespaces or empty string)
to `JSON.parse()`, and use an empty array instead.

This fixes an annoying `SyntaxError` in the console while loading the
file `Ovid.js` in the translators repository. That translator should be
fixed, too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant