-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add language-specific tests #15
Comments
Hi @arnavkapoor! Here a list of 20 numbers in Spanish that should be included in the language tests. I don't expect all of them to be working in the first version, especially for some single word examples, and we will probably need to add them in the The tests could be written with
Let me know if you have any doubt. P.S: I put the underscores in the numeric literals (PEP 515) to improve the readability. This could be an issue if we pretend to support Python 3.5, as it is only supported from Python 3.6. However, the support for Python 3.5 will finish in September and I expect to deprecate the support in |
I’ve been thinking about how we could extensively test our library against a language to be able to affirm that the library officially supports it. My first ideas were:
Doing the first it’s easy, but doing the second is not as easy. We can’t test all numbers, so we need to select a set of different numbers to check. After some time doing different, crazy, things, I got this list:
It’s created by appending the next digit to the end and then moving the first digit to the end (and then doing the same but with the digit before). It’s not perfect, but I think that it’s diverse enough to be able to say that if the parser works for these cases, it will probably work for the most common existing combinations. What do you think guys? @arnavkapoor @lopuhin @kishan3 I built some spiders to scrape different websites to get these numbers in words and added here the datasets: https://github.com/noviluni/numbers-data Sources:
Unfortunately, they don't support Hindi, but I can search a website supporting Hindi and create a new spider if it's necessary. If you like this idea, we can use these CSVs directly in the tests (don't worry about this, @arnavkapoor, I could show you how I would do it). In case you have another idea of input numbers for the tests, I can generate for you a dataset for a lot of locales with the numbers you want. Let me know what you think or if you have any other idea/approach. 🙂 |
@noviluni this is a great idea for the library , it can act as a basic threshold to say we support a language. ( and then language specific edge cases as you mentioned in the third point can be later added). |
We should add tests for the "officially" supported languages, that are (at this moment): Hindi, Spanish, Russian (English have already tests).
The text was updated successfully, but these errors were encountered: