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

Construct: support exception key top-level and in assertions #122

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

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Apr 11, 2024

As a result, a bunch of tests was generated that checks exceptions. I checked in the code, that Construct does not wrap exceptions in its own exception classes. I didn't check that new tests work

@generalmimon
Copy link
Member

I didn't check that new tests work

Well, that might be a problem.

I can tell you that this PR is useless in the current state, because the files generated by KSC for the construct target are meant to use only a completely separate Construct library, not our Python runtime library. Therefore, expecting Construct methods to raise exceptions like our Python target is nonsense, instead it should most likely be something from here.

@Mingun
Copy link
Contributor Author

Mingun commented Jul 9, 2024

It would be easier to test if CI could run these tests and show which exceptions would actually thrown. Feel free to edit this PR and use actual exceptions.

List of tests that depends on
`asserts[i].exception` key:
  expr_to_i_trailing

`exception` key:
  default_endian_expr_exception
  eof_exception_bytes
  eof_exception_sized
  eof_exception_u4
  eos_exception_bytes
  eos_exception_sized
  eos_exception_u4
  valid_fail_anyof_int
  valid_fail_contents
  valid_fail_eq_bytes
  valid_fail_eq_int
  valid_fail_eq_str
  valid_fail_expr
  valid_fail_inst
  valid_fail_max_int
  valid_fail_min_int
  valid_fail_range_bytes
  valid_fail_range_float
  valid_fail_range_int
  valid_fail_range_str
@Mingun Mingun force-pushed the construct-kst-fixes branch from 3a9eaef to ba05e7a Compare July 16, 2024 13:41
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