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

Replace assert with test_assert #4

Open
rerobika opened this issue Nov 13, 2018 · 1 comment
Open

Replace assert with test_assert #4

rerobika opened this issue Nov 13, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@rerobika
Copy link

In the generated files test_assert should be used instead of single assert.
This makes the test files engine independent.

Task:

  • Create a new script which generates compatibility.js and process the it's arguments.

Example:

  • python gen_compatibility.py --assert=console.assert

Output:

  • compatibility.js
  • Content: test_assert = console.assert
@rerobika rerobika added the enhancement New feature or request label Nov 13, 2018
@matedabis
Copy link
Contributor

Isn't it better to change the function's string template this way, and adding the option of giving the name of the assertion function to parse_args? With a default value assert.

validate_numeric = '''
function validate_numeric(test_value, expected_result, false_results) {
    var radix = 2 + Math.abs(expected_result % 35);
    {ASSERT}(test_value === expected_result);
    {ASSERT}(test_value.toString(radix) === expected_result.toString(radix));
    for (var i in false_results) {
        radix = 2 + Math.abs(false_results[i] % 35);
        {ASSERT}(test_value !== false_results[i]);
        {ASSERT}(test_value.toString(radix) !== false_results[i].toString(radix));
    }
}
'''

Do you agree with my suggestion or did you mean something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants