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

Fix toml-test scripts #433

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Fix toml-test scripts #433

merged 1 commit into from
Oct 10, 2023

Conversation

arp242
Copy link
Contributor

@arp242 arp242 commented Oct 10, 2023

Update tests/decoding_test.py to use the format used by the current version of toml-test. I also removed Python 2 support (my distro doesn't ship it, so I can't test it).

Also add tests/encoding_test.py for encoder tests

Still quite a few failures, mostly because it looks like it hasn't been updated to use 1.0 yet:

% toml-test ./decoding_test.py | tail -n2
  valid tests: 139 passed, 18 failed
invalid tests: 230 passed, 53 failed

% toml-test ./encoding_test.py -encoder | tail -n1
encoder tests: 146 passed, 11 failed

# e=0
# toml-test ./tests/decoding_test.py || e=1
# toml-test -encoder ./tests/encoding_test.py || e=1
# exit $e
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test this bit, but should be alright. You can add expected test failures with something like:

skip_dec=(
    -skip test1
    -skip test2
)
toml-test -skip $skip_dec[@] ./tests/decoding_test.py || e=1

Generate a list with something like:

toml-test -color never ./tests/decoding_test.py |& grep -a FAIL | sed 's/FAIL/-skip/'

return {'type': 'string', 'value': value}
elif isinstance(value, bool):
return {'type': 'bool', 'value': str(value).lower()}
elif isinstance(value, int):
return {'type': 'integer', 'value': str(value)}
elif isinstance(value, long):
elif isinstance(value, int):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is a duplicate elif block with python2 long changed to int for python3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers, fixed it.

Update tests/decoding_test.py to use the format used by the current
version of toml-test. I also removed Python 2 support (my distro doesn't
ship it, so I can't test it).

Also add tests/encoding_test.py for encoder tests

Still quite a few failures, mostly because it looks like it hasn't been
updated to use 1.0 yet:

    % toml-test ./decoding_test.py | tail -n2
      valid tests: 139 passed, 18 failed
    invalid tests: 230 passed, 53 failed

    % toml-test ./encoding_test.py -encoder | tail -n1
    encoder tests: 146 passed, 11 failed
@uiri uiri merged commit f6e1e4c into uiri:master Oct 10, 2023
@uiri
Copy link
Owner

uiri commented Oct 10, 2023

Merged. Thanks!

@arp242 arp242 deleted the enc-test branch October 10, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants