Make InvalidIdentifier exception subclass of ExpressionError to report invalid attributes correctly#312
Open
Mingun wants to merge 1 commit intokaitai-io:masterfrom
Open
Make InvalidIdentifier exception subclass of ExpressionError to report invalid attributes correctly#312Mingun wants to merge 1 commit intokaitai-io:masterfrom
InvalidIdentifier exception subclass of ExpressionError to report invalid attributes correctly#312Mingun wants to merge 1 commit intokaitai-io:masterfrom
Conversation
a2b5e81 to
9b4c5d6
Compare
Fixes test which instead of reporting error shows this exception: [info] - expr_bad_id_inst_value *** FAILED *** [info] io.kaitai.struct.format.InvalidIdentifier: invalid ID: 'BAD', expected /^[a-z][a-z0-9_]*$/ [info] at io.kaitai.struct.format.Identifier$.checkIdentifier(Identifier.scala:52) [info] at io.kaitai.struct.format.InstanceIdentifier.<init>(Identifier.scala:113) [info] at io.kaitai.struct.ClassTypeProvider.resolveMember(ClassTypeProvider.scala:83) [info] at io.kaitai.struct.ClassTypeProvider.determineType(ClassTypeProvider.scala:46) [info] at io.kaitai.struct.ClassTypeProvider.determineType(ClassTypeProvider.scala:20) [info] at io.kaitai.struct.translators.TypeDetector.detectTypeRaw(TypeDetector.scala:61) [info] at io.kaitai.struct.translators.TypeDetector.detectType(TypeDetector.scala:25) [info] at io.kaitai.struct.precompile.ValueTypesDeriver.$anonfun$deriveValueType$2(ValueTypesDeriver.scala:28) [info] at io.kaitai.struct.precompile.ValueTypesDeriver.$anonfun$deriveValueType$2$adapted(ValueTypesDeriver.scala:21) [info] at scala.collection.immutable.RedBlackTree$.foreach(RedBlackTree.scala:291) [info] ...
9b4c5d6 to
e0e4fcb
Compare
Contributor
Author
|
For the same strange reason as in #313, this PR adds new error (in comparison to 83dde4b) It seems to me, that the test was changed after running tests on master (83dde4b). @generalmimon, could you review this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test
Fixes test which instead of reporting error shows this exception:
Actually, I think, that this is incorrect test. You should check attribute IDs when you defines attribute, not when you use it. Obviously, you use that name with which attribute is defined. I expect, that this test will report unknown attribute
BADeven when it is obviously violates ID requirements